|
@ -13,72 +13,18 @@ |
|
|
|
|
|
|
|
|
# Print the IP address |
|
|
# Print the IP address |
|
|
_IP=$(hostname -I) || true |
|
|
_IP=$(hostname -I) || true |
|
|
if [ "$_IP" ]; then |
|
|
|
|
|
printf "My IP address is %s\n" "$_IP" |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# Check for statuses directory |
|
|
|
|
|
if [ ! -d /home/umbrel/statuses ]; then |
|
|
|
|
|
mkdir -p /home/umbrel/statuses |
|
|
|
|
|
# Ensure its writable by all |
|
|
|
|
|
chown -R umbrel.umbrel /home/umbrel/statuses |
|
|
|
|
|
chmod 777 /home/umbrel/statuses |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# Check for disk partition status |
|
|
if [ "$_IP" ]; then |
|
|
if [ ! -f /home/umbrel/statuses/disk-partitioned ]; then |
|
|
printf "My IP address is %s\n" "$_IP" |
|
|
if [ -f /home/umbrel/contrib/partitioner/partitioner.py ]; then |
|
|
|
|
|
echo "Run partition tool or quit out if unavailable" |
|
|
|
|
|
/home/umbrel/contrib/partitioner/partitioner.py || exit 1 |
|
|
|
|
|
|
|
|
|
|
|
touch /home/umbrel/statuses/disk-partitioned |
|
|
|
|
|
chown -R umbrel.umbrel /home/umbrel/statuses/disk-partitioned |
|
|
|
|
|
else |
|
|
|
|
|
echo "Could not find partition tool - some steps might be skipped" |
|
|
|
|
|
fi |
|
|
|
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
if [ ! -f /home/umbrel/statuses/service-configured ]; then |
|
|
UMBREL_BOOT_SCRIPT=/home/umbrel/scripts/umbrel-os/boot |
|
|
if [ -f /home/umbrel/configure-box.sh ]; then |
|
|
|
|
|
echo "Running configuration script" |
|
|
|
|
|
cd /home/umbrel |
|
|
|
|
|
./configure-box.sh || exit 1 |
|
|
|
|
|
# Marking this as done so we don't do configuration again |
|
|
|
|
|
touch /home/umbrel/statuses/service-configured |
|
|
|
|
|
chown -R umbrel.umbrel /home/umbrel/statuses/service-configured |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# Next stage, check if service-configured |
|
|
# Check for statuses directory |
|
|
echo "Service configured.. Checking for partitioned state" |
|
|
if [ -x "$UMBREL_BOOT_SCRIPT" ]; then |
|
|
if [ -f /home/umbrel/statuses/disk-partitioned ]; then |
|
|
"$UMBREL_BOOT_SCRIPT" || exit 1 |
|
|
if [ ! -f /etc/rc2.d/S01umbrel ]; then |
|
|
else |
|
|
echo "Set up symlinks" |
|
|
echo "There's no boot script at $UMBREL_BOOT_SCRIPT" |
|
|
ln -s /etc/init.d/umbrel /etc/rc2.d/S01umbrel |
|
|
|
|
|
ln -s /etc/init.d/umbrel /etc/rc3.d/S01umbrel |
|
|
|
|
|
ln -s /etc/init.d/umbrel /etc/rc4.d/S01umbrel |
|
|
|
|
|
ln -s /etc/init.d/umbrel /etc/rc5.d/S01umbrel |
|
|
|
|
|
ln -s /etc/init.d/umbrel /etc/rc0.d/K01umbrel |
|
|
|
|
|
ln -s /etc/init.d/umbrel /etc/rc1.d/K01umbrel |
|
|
|
|
|
ln -s /etc/init.d/umbrel /etc/rc6.d/K01umbrel |
|
|
|
|
|
# Do partitioning at first boot |
|
|
|
|
|
echo "Enabling defaults for umbrel" |
|
|
|
|
|
update-rc.d umbrel defaults || exit 1 |
|
|
|
|
|
echo "Enabling startup for umbrel box" |
|
|
|
|
|
update-rc.d umbrel enable || exit 1 |
|
|
|
|
|
echo "starting up umbrel get it started now)" |
|
|
|
|
|
/etc/init.d/umbrel start |
|
|
|
|
|
fi |
|
|
|
|
|
else |
|
|
|
|
|
echo "Disk not partitioned, will not start umbrel framework (Please do it manually)" |
|
|
|
|
|
fi |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# Display connection details on the TTY |
|
|
|
|
|
if [ -x "$(command -v umbrel-details)" ]; then |
|
|
|
|
|
# We run this in the background because it waits for the Tor hidden service |
|
|
|
|
|
# to be created on first boot. rc.local needs to exit so the boot process |
|
|
|
|
|
# can continue. |
|
|
|
|
|
umbrel-details & |
|
|
|
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
exit 0 |
|
|
exit 0 |
|
|