cron.sh: identify & fix issues thanks to shellcheck

This commit is contained in:
Starbeamrainbowlabs 2020-06-10 17:05:58 +01:00
parent c8a70c8ca9
commit d5eec9cf94
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -5,7 +5,8 @@ source="/home/ci/sftp-root/CIAptPackages";
destination="/srv/aptosaurus/sources"; destination="/srv/aptosaurus/sources";
aptosaurus="/srv/aptosaurus/aptosaurus.sh"; aptosaurus="/srv/aptosaurus/aptosaurus.sh";
export HOME="$(dirname "${aptosaurus}")"; HOME="$(dirname "${aptosaurus}")";
export HOME;
# The user account to chown to & run aptosaurus under # The user account to chown to & run aptosaurus under
# FUTURE: Use own account? Is it worth it for a cron job? # FUTURE: Use own account? Is it worth it for a cron job?
@ -19,5 +20,5 @@ chown -R "${user_account}:${user_account}" "${destination}";
# Re-run aptosaurus # Re-run aptosaurus
aptosaurus_dir="$(dirname "${aptosaurus}")"; aptosaurus_dir="$(dirname "${aptosaurus}")";
cd "${aptosaurus_dir}" || { echo "Failed to cd into aptosaurus directory"; exit 1}; cd "${aptosaurus_dir}" || { echo "Failed to cd into aptosaurus directory"; exit 1; };
sudo -u "${user_account}" bash "$(basename "${aptosaurus}")" update-cron; sudo -u "${user_account}" bash "$(basename "${aptosaurus}")" update-cron;