From aa19ea2f308542f706be4e0609c612caa89a918a Mon Sep 17 00:00:00 2001
From: nolim1t <hello@nolim1t.co>
Date: Sun, 31 May 2020 22:25:38 +0700
Subject: [PATCH] Add runlevel symlinks in rc.local

Add docker-compose symlinks
---
 stage2/01-sys-tweaks/files/rc.local | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/stage2/01-sys-tweaks/files/rc.local b/stage2/01-sys-tweaks/files/rc.local
index 0cb6635..a7fc346 100755
--- a/stage2/01-sys-tweaks/files/rc.local
+++ b/stage2/01-sys-tweaks/files/rc.local
@@ -48,7 +48,7 @@ if [ ! -f /home/umbrel/statuses/service-configured ]; then
         cat /home/umbrel/secrets/rpcauth.txt >> /home/umbrel/bitcoin/bitcoin.conf
         # Update RPC Passwords for both LND and INVOICER
         RPCPASS=`cat /home/umbrel/secrets/rpcpass.txt`
-        sed -i "s/RPCPASS/${RPCPASS}/g;" /home/umbrel/invoicer/invoicer.conf
+        sed -i "s/RPCPASS/${RPCPASS}/g;" /home/umbrel/docker-compose.yml
         sed -i "s/RPCPASS/${RPCPASS}/g;" /home/umbrel/lnd/lnd.conf
 
         # Making this as done so we don't go through updates again
@@ -61,6 +61,14 @@ if [ ! -f /home/umbrel/statuses/service-configured ]; then
       echo "Service configured.. Checking for partitioned state"
       if [ -f /home/umbrel/statuses/disk-partitioned ]; then
           echo "If disk partitioned then start up Umbrel"
+          echo "Set up symlinks"
+          ln -s /etc/init.d/umbrelbox /etc/rc2.d/S01umbrelbox
+          ln -s /etc/init.d/umbrelbox /etc/rc3.d/S01umbrelbox
+          ln -s /etc/init.d/umbrelbox /etc/rc4.d/S01umbrelbox
+          ln -s /etc/init.d/umbrelbox /etc/rc5.d/S01umbrelbox
+          ln -s /etc/init.d/umbrelbox /etc/rc0.d/K01umbrelbox
+          ln -s /etc/init.d/umbrelbox /etc/rc1.d/K01umbrelbox
+          ln -s /etc/init.d/umbrelbox /etc/rc6.d/K01umbrelbox
           # Do partitioning at first boot
           echo "Enabling defaults for umbrelbox"
           update-rc.d umbrelbox defaults || exit 1