diff --git a/clone/.clone.swp b/clone/.clone.swp new file mode 100644 index 0000000..e539ed3 Binary files /dev/null and b/clone/.clone.swp differ diff --git a/clone/clone b/clone/clone index fbda072..0e02f36 100755 --- a/clone/clone +++ b/clone/clone @@ -213,7 +213,7 @@ step7(){ # (9) Define config alias with ssh-key # echo " (.) Define alias config"; - echo "Host\tsmmp-server\n\tHostname\t$SERVER_HOSTNAME\n\tUser\t$SERVER_USERNAME\n\tIdentityFile\t~/.ssh/id_ecdsa\n" | sudo tee /mnt/home/sats/.ssh/config > /dev/null; + echo "Host\tsmmp-server\n\tHostname\t${SERVER_HOSTNAME}\n\tUser\t${SERVER_USERNAME}\n\tIdentityFile\t~/.ssh/id_ecdsa\n" | sudo tee /mnt/home/sats/.ssh/config > /dev/null; sudo chown 666:666 /mnt/home/sats/.ssh/config; sudo chmod 444 /mnt/home/sats/.ssh/config; @@ -280,15 +280,16 @@ step10(){ # (2) Set up SATS botting script # echo " (.) Set up SATS booting script"; - cat ./utility/booting_script | sudo tee /mnt/home/sats/satsd/boot; + cat ./utility/booting_script | sudo tee /mnt/home/sats/satsd/boot > /dev/null; # (3) Set up service unit # echo " (.) Set up service unit (sats.service)"; - cat ./utility/service_unit | sudo tee /mnt/lib/systemd/system/sats.service; + cat ./utility/service_unit | sudo tee /mnt/lib/systemd/system/sats.service > /dev/null; # (4) Enable startup service unit # echo " (.) Emulate \`systemctl enable sats.service\`"; - sudo ln -fs /lib/systemd/system/sats.service /mnt/etc/systemd/system/sats.service; + sudo mkdir -p /mnt/etc/systemd/system/multi-user.target.wants; + sudo ln -fs /lib/systemd/system/sats.service /mnt/etc/systemd/system/multi-user.target.wants/sats.service; # (5) Adjust permissions # echo " (.) Adjust permissions"; @@ -303,6 +304,17 @@ step10(){ } + +# [11] BLablslkfjdlkdsjfks +#========================================================# +step11(){ + + sudo umount /mnt; + +} + + + # [0] Step choice #========================================================# echo "\nSTEPS"; diff --git a/clone/utility/booting_script b/clone/utility/booting_script index 41b20d5..bbf174e 100644 --- a/clone/utility/booting_script +++ b/clone/utility/booting_script @@ -4,7 +4,7 @@ if [ -e /home/sats/satsd/first_install ]; then # install source code - git clone ssh://smmp-server/satsd /mnt/home/sats/satsd/source \ + git clone ssh://smmp-server/satsd /home/sats/satsd/source \ && rm /home/sats/satsd/first_install \ || exit; diff --git a/clone/utility/service_unit b/clone/utility/service_unit index 7e9344f..19042e5 100644 --- a/clone/utility/service_unit +++ b/clone/utility/service_unit @@ -3,9 +3,11 @@ Description=SATS (Secure Authentication and Tracking SYSTEM) Daemon After=multi-user.target [Service] -Type=idle -ExecStart=-/bin/sh /home/sats/satsd/boot service 2>> /home/sats/satsd/log/boot.log >> /home/sats/satsd/log/boot.log +Type=Simple User=sats +ExecStart=/bin/sh /home/sats/satsd/boot service 2>> /home/sats/satsd/log/boot.log >> /home/sats/satsd/log/boot.log +Restart=on-abort + [Install] WantedBy=multi-user.target