#!/bin/sh # [0] Check synced first if [ ! -e /target/sync ]; then exit 1; fi; # [1] Override permissions if not sudo chown sats:pi /home/sats/satsd/source; sudo chown sats:pi /home/sats/satsd/source/daemon; sudo chown -R sats:pi /home/sats/satsd/log/; sudo chmod 750 /home/sats/satsd/source; sudo chmod 750 /home/sats/satsd/source/daemon; sudo chmod -R 770 /home/sats/satsd/log/; # [2] Propagate script to DAEMON /bin/bash /home/sats/satsd/source/daemon | sudo -u sats tee -a /home/sats/satsd/log/daemon.log;