mirror of
https://github.com/msfjarvis/server-config
synced 2025-08-14 17:37:02 +05:30
systemd: run goaccess run every 10 minutes in non-live mode
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
4994dd060a
commit
8ee6ac80de
3 changed files with 29 additions and 1 deletions
|
@ -9,6 +9,7 @@ function prettyPrint() {
|
|||
|
||||
# Grab all service names
|
||||
declare -a services=('caddy' 'goaccess' 'mirror-bot' 'mirror-bot-2' 'uno-bot' 'walls-bot' 'walls-bot-rs')
|
||||
declare -a timers=('goaccess-update')
|
||||
|
||||
# Now loop through each service and install it
|
||||
for service in "${services[@]}"; do
|
||||
|
@ -29,3 +30,18 @@ for service in "${services[@]}"; do
|
|||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
for timer in "${timers[@]}"; do
|
||||
if [ "${1}" ] && [[ ${timer} != "${1}" && "${timer}.timer" != "${1}" ]]; then
|
||||
continue
|
||||
fi
|
||||
prettyPrint "Checking root access"
|
||||
sudo -v || return 1
|
||||
prettyPrint "Installing ${timer}"
|
||||
sudo cp -v "${timer}.timer" /etc/systemd/system/
|
||||
sudo systemctl daemon-reload
|
||||
if [ -z "${NO_RESTART}" ]; then
|
||||
prettyPrint "Enabling ${timer}"
|
||||
sudo systemctl enable "${timer}.timer"
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue