refactor main, new script to update all services
- continue to cut main into functions - started pylint - script to update all and log
This commit is contained in:
35
update_all
Executable file
35
update_all
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
declare -a services
|
||||
services+=('git')
|
||||
services+=('plex')
|
||||
services+=('jellyfin')
|
||||
services+=('photoprism')
|
||||
services+=('nextcloud')
|
||||
services+=('read')
|
||||
services+=('www')
|
||||
services+=('chat')
|
||||
|
||||
ts="$(date '+%Y-%m-%d')"
|
||||
|
||||
if ! sudo printf 'Sudo successful.\n'; then
|
||||
printf 'sudo failed.\n' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! pass show test; then
|
||||
printf 'failed to access passwords.\n' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
logdir="/data/logs/ssl/${ts}"
|
||||
mkdir -p "$logdir"
|
||||
|
||||
for service in "${services[@]}"; do
|
||||
log="${logdir}/${service}.log"
|
||||
if ! sudo ./ssl-update.py "$service" &> "$log"; then
|
||||
printf '%s failed. Log: %s\n' "$service" "$log"
|
||||
else
|
||||
printf '%s succeeded.\n' "$service"
|
||||
fi
|
||||
done
|
Reference in New Issue
Block a user