Move manual hosts definition to configuration file manual_hosts.conf
This commit is contained in:
parent
c31323a439
commit
6e83231078
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,6 +1,7 @@
|
||||
*.swp
|
||||
/conf/logrotate.conf
|
||||
/conf/rcopy.conf
|
||||
/conf/manual_hosts.conf
|
||||
/conf/*.key
|
||||
/hosts/*.sh
|
||||
/hosts/BAK/*
|
||||
|
6
conf/manual_hosts.conf.sample
Normal file
6
conf/manual_hosts.conf.sample
Normal 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"
|
@ -391,5 +391,7 @@ else
|
||||
fi
|
||||
|
||||
if $_via_ssh_tunnel ; then
|
||||
kill $tunnel_pid
|
||||
if [[ -n "$tunnel_pid" ]]; then
|
||||
kill "$tunnel_pid"
|
||||
fi
|
||||
fi
|
||||
|
11
rcopy.sh
11
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
|
||||
|
Loading…
Reference in New Issue
Block a user