diff --git a/clone/clone b/clone/clone index ae13b2f..a84cfe4 100755 --- a/clone/clone +++ b/clone/clone @@ -247,7 +247,7 @@ step6(){ # [7] Set up systemd services #========================================================# step7(){ - echo -e "\n>>> [7] Set up systemd background"; + echo -e "\n>>> [7] Set up systemd units"; # (0) Create useful folders # @@ -287,13 +287,20 @@ step7(){ # (8) Create sats-update script # echo " (.) Create sats-update script"; - cat ./utility/sats-update | sudo tee /mnt/service/sats-update > /dev/null; + cat ./utility/sats-update | sudo tee /mnt/service/sats-update > /dev/null; # (8) Create sats-loop script # echo " (.) Create sats-loop script"; - cat ./utility/sats-loop | sudo tee /mnt/service/sats-loop > /dev/null; + cat ./utility/sats-loop | sudo tee /mnt/service/sats-loop > /dev/null; - # (9) Set up permissions # + # (9) Create sats-update timer # + echo " (.) Create sats-update timer"; + echo " - Create sats-loop.timer file"; + cat ./utility/sats-update.timer | sudo tee /mnt/service/sats-update.timer > /dev/null; + echo " - Emulate \`systemctl enable sats-loop.timer\`"; + sudo ln -fs /lib/systemd/system/sats-update.timer /mnt/etc/systemd/system/multi-user.target.wants/sats-update.timer; + + # (10) Set up permissions # echo " (.) Set up permissions"; echo " - sats-install @pi"; sudo chown 1000:1000 /mnt/service/sats-install; diff --git a/clone/utility/sats-update.timer b/clone/utility/sats-update.timer new file mode 100644 index 0000000..28572b9 --- /dev/null +++ b/clone/utility/sats-update.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Timer to schedule sats-update (every minute) +Before=sats-update.service + +[Timer] +OnCalendar=*-*-* *:*:00 + +[Install] +WantedBy=multi-user.target \ No newline at end of file