Add a default for backup

This commit is contained in:
Micke Nordin 2023-06-13 11:59:19 +02:00
parent 95030efba2
commit a9fdb43bf6
Signed by untrusted user: Micke
GPG key ID: 0DA0A7A5708FE257

View file

@ -6,6 +6,9 @@ sleep $((16#$(ip a | grep "link/ether" | head -1 | awk -F ':' '{print $6}' | awk
number_of_full_to_keep="<%= @full_backup_retention %>" number_of_full_to_keep="<%= @full_backup_retention %>"
backup="${1}" backup="${1}"
if [[ -z ${backup} ]]; then
backup="backup1.$(hostname -d)"
fi
if ! [[ ${backup} =~ backup1.*sunet.se$ ]]; then if ! [[ ${backup} =~ backup1.*sunet.se$ ]]; then
echo "Usage: ${0} <fqdn of backup server>" echo "Usage: ${0} <fqdn of backup server>"
echo "Example: ${0} backup1.sunet.drive.sunet.se" echo "Example: ${0} backup1.sunet.drive.sunet.se"