cron.sh: identify & fix issues thanks to shellcheck
This commit is contained in:
parent
c8a70c8ca9
commit
d5eec9cf94
1 changed files with 3 additions and 2 deletions
5
cron.sh
5
cron.sh
|
@ -5,7 +5,8 @@ source="/home/ci/sftp-root/CIAptPackages";
|
|||
destination="/srv/aptosaurus/sources";
|
||||
aptosaurus="/srv/aptosaurus/aptosaurus.sh";
|
||||
|
||||
export HOME="$(dirname "${aptosaurus}")";
|
||||
HOME="$(dirname "${aptosaurus}")";
|
||||
export HOME;
|
||||
|
||||
# The user account to chown to & run aptosaurus under
|
||||
# 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
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue