diff --git a/.gitignore b/.gitignore index ae12556..db5b411 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.swp /conf/logrotate.conf /conf/rcopy.conf +/conf/manual_hosts.conf /conf/*.key /hosts/*.sh /hosts/BAK/* diff --git a/conf/manual_hosts.conf.sample b/conf/manual_hosts.conf.sample new file mode 100644 index 0000000..4077273 --- /dev/null +++ b/conf/manual_hosts.conf.sample @@ -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" diff --git a/hosts/scripts/main_part.include b/hosts/scripts/main_part.include index f129d6d..588d335 100644 --- a/hosts/scripts/main_part.include +++ b/hosts/scripts/main_part.include @@ -391,5 +391,7 @@ else fi if $_via_ssh_tunnel ; then - kill $tunnel_pid + if [[ -n "$tunnel_pid" ]]; then + kill "$tunnel_pid" + fi fi diff --git a/rcopy.sh b/rcopy.sh index 7f8b870..c5f4f4c 100755 --- a/rcopy.sh +++ b/rcopy.sh @@ -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