Browse Source

cron.sh: identify & fix issues thanks to shellcheck

master
Starbeamrainbowlabs 5 months ago
parent
commit
d5eec9cf94
Signed by: sbrl GPG Key ID: 1BE5172E637709C2
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      cron.sh

+ 3
- 2
cron.sh View File

@@ -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…
Cancel
Save