Add check for nc binary

This commit is contained in:
Emil Dabrowski 2022-11-27 21:57:54 +01:00
parent 58cb637f72
commit 4e44267a70
1 changed files with 6 additions and 2 deletions

View File

@ -120,10 +120,14 @@ if ! is_int "$max_minutes_since_last_backup"; then
echxit "ERROR: Invalid or unset value for argument -b: '$max_minutes_since_last_backup'" 2 echxit "ERROR: Invalid or unset value for argument -b: '$max_minutes_since_last_backup'" 2
fi fi
for bin in jq nc; do
if ! command -v "$bin" >/dev/null; then
echxit "ERROR: '$bin' not installed" 3
fi
done
if ! im_root; then if ! im_root; then
echxit "ERROR: This script must be run as root" 1 echxit "ERROR: This script must be run as root" 1
elif ! command -v jq >/dev/null; then
echxit "ERROR: jq not installed" 3
elif pgrep -f "$borg" >/dev/null; then elif pgrep -f "$borg" >/dev/null; then
echxit "ERROR: Borg seems to be active already" 11 echxit "ERROR: Borg seems to be active already" 11
elif [ -n "$remote_host_port" ]; then elif [ -n "$remote_host_port" ]; then