Move manual hosts definition to configuration file manual_hosts.conf

This commit is contained in:
Christoph 2019-06-26 12:43:54 +02:00
parent c31323a439
commit 6e83231078
4 changed files with 20 additions and 2 deletions

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
*.swp
/conf/logrotate.conf
/conf/rcopy.conf
/conf/manual_hosts.conf
/conf/*.key
/hosts/*.sh
/hosts/BAK/*

View File

@ -0,0 +1,6 @@
# If script is called with "manual=true" the following hosts scripts
# will be executed
#
# Multiple hosts are possible, give a blank separated list
#
host_scripts="${hosts_base_dir}/localhost.sh"

View File

@ -391,5 +391,7 @@ else
fi
if $_via_ssh_tunnel ; then
kill $tunnel_pid
if [[ -n "$tunnel_pid" ]]; then
kill "$tunnel_pid"
fi
fi

View File

@ -27,6 +27,7 @@ if $manual ; then
## -
send_reminder=false
restart_samba_service=false
manual_hosts_file="${rcopy_base_dir}/conf/manual_hosts.conf"
fi
## - Note: the file "/var/lib/logrotate/status" must have
@ -235,8 +236,16 @@ fi
## - searching hosts for backup
## -
host_scripts=""
if $manual ; then
host_scripts="${hosts_base_dir}/localhost.sh"
if [[ -f "$manual_hosts_file" ]] ; then
source "$manual_hosts_file"
for script in $hosts ; do
host_scripts="$host_scripts ${hosts_base_dir}/${script}.sh"
done
else
host_scripts="${hosts_base_dir}/localhost.sh"
fi
else
host_scripts=`$find $hosts_base_dir -maxdepth 1 -type f -perm -700 | $sort`
fi