diff --git a/clone/clone b/clone/clone index 1f207ea..a98ae91 100755 --- a/clone/clone +++ b/clone/clone @@ -308,20 +308,28 @@ step9(){ sudo mkdir -p /mnt/home/sats/satsd/conf; sudo touch /mnt/home/sats/satsd/first_install; - # (2) Set up SATS botting script # + # (2) Create default configuration files # + echo " (.) Create default configuration/log files"; + echo $DEFAULT_BRANCH | sudo tee /mnt/home/sats/satsd/conf/branch > /dev/null; + echo $MACHINE_ID | sudo tee /mnt/home/sats/satsd/conf/id > /dev/null; + + echo "" | sudo tee /mnt/home/sats/satsd/log/access.log > /dev/null; + + + # (3) Set up SATS botting script # echo " (.) Set up SATS booting script"; cat ./utility/sats-loop | sudo tee /mnt/home/sats/satsd/sats-loop > /dev/null; - # (3) Set up service unit # + # (4) Set up service unit # echo " (.) Set up service unit (sats-loop.service)"; cat ./utility/sats-loop.service | sudo tee /mnt/lib/systemd/system/sats-loop.service > /dev/null; - # (4) Enable startup service unit # + # (5) Enable startup service unit # echo " (.) Emulate \`systemctl enable sats-loop.service\`"; sudo mkdir -p /mnt/etc/systemd/system/multi-user.target.wants; sudo ln -fs /lib/systemd/system/sats-loop.service /mnt/etc/systemd/system/multi-user.target.wants/sats-loop.service; - # (5) Adjust permissions # + # (6) Adjust permissions # echo " (.) Adjust permissions"; sudo chown -R 666:666 /mnt/home/sats/satsd; sudo chmod -R 770 /mnt/home/sats/satsd; diff --git a/clone/clone.conf b/clone/clone.conf index 2165e87..913dc43 100755 --- a/clone/clone.conf +++ b/clone/clone.conf @@ -8,5 +8,6 @@ export WIFI_PASS=" manon adrien "; export SERVER_HOSTNAME="xdrm.io"; export SERVER_USERNAME="satsd"; -# DEBUG SETTINGS -export LOCK_PI=1; +# DEFAULT SATS SETTINGS +export DEFAULT_BRANCH="1.0"; +export MACHINE_ID=$(date +%s); diff --git a/clone/utility/install-source b/clone/utility/install-source index f98e121..f02ba15 100644 --- a/clone/utility/install-source +++ b/clone/utility/install-source @@ -9,7 +9,7 @@ if [ -e /home/sats/satsd/first_install ]; then # (1) With git if installed # if [ $gitinstalled -eq 1 ]; then - git clone ssh://smmp-server/satsd/git /home/sats/satsd/source \ + git clone -b $BRANCH ssh://smmp-server/satsd/git /home/sats/satsd/source \ && rm /home/sats/satsd/first_install \ || exit;