Major upgrades:

Adding some new files/directories.
Adjust some existing backups.
This commit is contained in:
Christoph 2017-02-25 04:10:05 +01:00
parent 44f6559042
commit 81dd5e7a2a
3 changed files with 623 additions and 333 deletions

View File

@ -59,14 +59,18 @@ exit
}
function echo_OK() {
echo_OK() {
echo -en "\\033[45G[ \\033[1;32mOK\\033[0;39m ]\n"
}
function echo_FAILED() {
echo_FAILED() {
echo -en "\\033[45G[ \\033[1;31mFAIL\\033[0;39m ]\n"
}
echo_SKIPPED() {
echo -en "\\033[45G[ \\033[1;37mFAIL\\033[0;39m ]\n"
}
[ $# -ne "1" ] && usage "wrong number of arguments"
@ -176,40 +180,42 @@ fi
# - DHCP Server
# - /etc/dhcp/dhcpd.conf
echo -en "\tDHCP Server settings.."
if [ -d /etc/dhcp ]; then
cp -a ${base_dir}/${network}/dhcpd.conf.${network} /etc/dhcp/dhcpd.conf
if [ "$?" != "0" ]; then
echo_FAILED
else
echo_OK
fi
elif [ -d /etc/dhcp3 ];then
cp -a ${base_dir}/${network}/dhcpd.conf.${network} /etc/dhcp3/dhcpd.conf
if [ "$?" != "0" ]; then
echo_FAILED
else
echo_OK
fi
fi
if [ -f ${base_dir}/${network}/dhcpd6.conf.${network} ];then
echo -en "\tDHCP IPv6 Server settings.."
if [ -d /etc/dhcp ]; then
cp -a ${base_dir}/${network}/dhcpd6.conf.${network} /etc/dhcp/dhcpd6.conf
if [ "$?" != "0" ]; then
echo_FAILED
else
echo_OK
fi
elif [ -d /etc/dhcp3 ];then
cp -a ${base_dir}/${network}/dhcpd6.conf.${network} /etc/dhcp3/dhcpd6.conf
if [ "$?" != "0" ]; then
echo_FAILED
else
echo_OK
files="dhcpd.conf.${network}
dhcpd6.conf.${network}
hosts.lan.conf.${_network}
hosts.w-lan.conf.${_network}"
failed=false
success=false
for file in $files ; do
file_real_name="${file%.*}"
if [[ -f "${base_dir}/${network}/$file" ]]; then
if [[ -d /etc/dhcp ]]; then
cp -a ${base_dir}/${network}/$file /etc/dhcp/
if [[ "$?" = "0" ]]; then
success=true
else
failed=true
fi
elif [[ -d /etc/dhcp3 ]] ;then
cp -a ${base_dir}/${network}/$file /etc/dhcp3/
if [[ "$?" = "0" ]]; then
success=true
else
failed=true
fi
fi
fi
done
if $failed ; then
echo_FAILED
elif $success ; then
echo_OK
else
echo_SKIPPED
fi
#if [ -f "${base_dir}/${network}/isc-dhcp6-server.${network}" ]; then
# echo -en "\tINIT-Script isc-dhcp6-server.."
# cp -a ${base_dir}/${network}/isc-dhcp6-server.${network} /etc/init.d/isc-dhcp6-server
@ -224,19 +230,23 @@ fi
# - DSL:
# - /etc/ppp/peers/dsl-provider
# - /etc/ppp/ip-up.d/email_notice
rval=true
echo -en "\tDSL settings.."
_rval=true
cp -a ${base_dir}/${network}/dsl-provider.${network} /etc/ppp/peers/dsl-provider
if [ "$?" != "0" ]; then
_rval=false
if [[ -d "/etc/ppp/peers" ]]; then
if [[ -d "{base_dir}/${network}/peers" ]]; then
cp -a ${base_dir}/${network}/peers/* /etc/ppp/peers/
if [ "$?" != "0" ]; then
_rval=false
fi
fi
fi
_network_name=`echo $network | tr '[:upper:]' '[:lower:]'`
if [ -f ${base_dir}/${network}/dsl-${_network_name}.${network} ]; then
cp -a ${base_dir}/${network}/dsl-${_network_name}.${network} /etc/ppp/peers/dsl-${_network_name}
fi
cp -a ${base_dir}/${network}/email_notice.${network} /etc/ppp/ip-up.d/email_notice
if [ "$?" != "0" ]; then
_rval=false
if [[ -f "{base_dir}/${network}/email_notice.${network}" ]] ; then
cp -a ${base_dir}/${network}/email_notice.${network} /etc/ppp/ip-up.d/email_notice
if [ "$?" != "0" ]; then
_rval=false
fi
fi
cp -a ${base_dir}/${network}/pap-secrets.${network} /etc/ppp/pap-secrets
if [ "$?" != "0" ]; then
@ -323,17 +333,95 @@ else
fi
# - Firewall:
# - /usr/local/src directory
# -
echo -en "\tFirewall.."
if [ -f ${base_dir}/${network}/ipt-firewall.${network} ]; then
cp -a ${base_dir}/${network}/ipt-firewall.${network} /etc/init.d/ipt-firewall
if [ "$?" != "0" ]; then
echo -en "\t/root/bin directory"
if [[ -d "${base_dir}/${network}/bin" ]]; then
if [[ ! -d "/root/bin" ]]; then
mkdir /root/bin
fi
cp -a ${base_dir}/${network}/bin/* /root/bin/
if ! $_rval ; then
echo_FAILED
else
echo_OK
fi
else
echo_SKIPPED
fi
# - /usr/local/src directory
# -
echo -en "\t/usr/local/src directory"
if [[ -d "${base_dir}/${network}/src" ]]; then
cp -a ${base_dir}/${network}/src/* /usr/local/src/
if ! $_rval ; then
echo_FAILED
else
echo_OK
fi
else
echo_SKIPPED
fi
# - /usr/local/sbin directory
# -
echo -en "\t/usr/local/sbin directory"
if [[ -d "${base_dir}/${network}/sbin" ]]; then
cp -a ${base_dir}/${network}/sbin/* /usr/local/sbin/
if ! $_rval ; then
echo_FAILED
else
echo_OK
fi
else
echo_SKIPPED
fi
# - Firewall:
# -
_rval=true
echo -en "\tFirewall.."
if [[ -d "${base_dir}/${network}/ipt-firewall" ]]; then
if [[ -d "/etc/ipt-firewall" ]]; then
rm -rf /etc/ipt-firewall
fi
mkdir -p /etc/ipt-firewall
cp -a ${base_dir}/${network}/ipt-firewall /etc/
if [ "$?" != "0" ]; then
_rval=false
fi
else
if [[ -d "/etc/ipt-firewall" ]]; then
rm -rf /etc/ipt-firewall
fi
fi
if [ -f ${base_dir}/${network}/ipt-firewall.${network} ]; then
cp -a ${base_dir}/${network}/ipt-firewall.${network} /etc/init.d/ipt-firewall
if [ "$?" != "0" ]; then
_rval=false
fi
else
rm -f /etc/init.d/ipt-firewall
fi
if [ -f ${base_dir}/${network}/ip6t-firewall.${network} ]; then
cp -a ${base_dir}/${network}/ip6t-firewall.${network} /etc/init.d/ip6t-firewall
if [ "$?" != "0" ]; then
_rval=false
fi
else
if [ -f "/etc/init.d/ip6t-firewall" ]; then
rm -f /etc/init.d/ip6t-firewall
fi
fi
if [ -f ${base_dir}/${network}/ip6t-firewall.${network} ]; then
echo -en "\tFirewall IPv6.."
cp -a ${base_dir}/${network}/ip6t-firewall.${network} /etc/init.d/ip6t-firewall
@ -347,102 +435,114 @@ else
rm /etc/init.d/ip6t-firewall
fi
fi
_rval=true
if [ -f ${base_dir}/${network}/ipt-firewall.service.${_network} ] ; then
if [[ -f "${base_dir}/${network}/ipt-firewall.service.${network}" ]]; then
cp ${base_dir}/${network}/ipt-firewall.service.${network} /etc/systemd/system/ipt-firewall.service
if [ "$?" != "0" ]; then
_rval=false
fi
systemctl daemon-reload
if [ "$?" != "0" ]; then
_rval=false
fi
systemctl enable ipt-firewall.service
if [ "$?" != "0" ]; then
_rval=false
fi
cp -a ${base_dir}/${network}/ipt-firewall.service.${_network} /etc/systemd/system/ipt-firewall.service
if [ "$?" != "0" ]; then
_rval=false
fi
cp -a ${base_dir}/${network}/ipt-firewall-gateway.${_network} /usr/local/sbin/ipt-firewall-gateway
if [ "$?" != "0" ]; then
_rval=false
fi
mkdir -p /etc/ipt-firewall
if [ "$?" != "0" ]; then
_rval=false
fi
cp -a ${base_dir}/${network}/ipt-firewall-gateway.conf.${_network} /etc/ipt-firewall/ipt-firewall-gateway.conf
if [ "$?" != "0" ]; then
_rval=false
fi
if ! $_rval ; then
echo_FAILED
else
echo_OK
else
if [[ -f "/etc/systemd/system/ipt-firewall.service" ]]; then
systemctl disable ipt-firewall.service
rm /etc/systemd/system/ipt-firewall.service
fi
fi
_rval=true
if [ -f ${base_dir}/${network}/ip6t-firewall.service.${_network} ] ; then
if [[ -f "${base_dir}/${network}/ip6t-firewall.service.${network}" ]]; then
cp ${base_dir}/${network}/ip6t-firewall.service.${network} /etc/systemd/system/ip6t-firewall.service
if [ "$?" != "0" ]; then
_rval=false
fi
systemctl daemon-reload
if [ "$?" != "0" ]; then
_rval=false
fi
systemctl enable ip6t-firewall.service
if [ "$?" != "0" ]; then
_rval=false
fi
cp -a ${base_dir}/${network}/ip6t-firewall.service.${_network} /etc/systemd/system/ip6t-firewall.service
if [ "$?" != "0" ]; then
_rval=false
fi
cp -a ${base_dir}/${network}/ip6t-firewall-gateway.${_network} /usr/local/sbin/ip6t-firewall-gateway
if [ "$?" != "0" ]; then
_rval=false
fi
cp -a ${base_dir}/${network}/ip6t-firewall-gateway.conf.${_network} /etc/ipt-firewall/ip6t-firewall-gateway.conf
if [ "$?" != "0" ]; then
_rval=false
fi
if ! $_rval ; then
echo_FAILED
else
echo_OK
else
if [[ -f "/etc/systemd/system/ip6t-firewall.service" ]]; then
systemctl disable ip6t-firewall.service
rm /etc/systemd/system/ip6t-firewall.service
fi
fi
if ! $_rval ; then
echo_FAILED
else
echo_OK
fi
# - Check Script Onlinestatus
# -
echo -en "\tCheck Script Onlinestatus.."
_rval=true
if [[ -d "${base_dir}/${network}/check_net" ]]; then
if [[ -d "/etceck_net" ]]; then
rm -rf /etc/check_net
fi
mkdir -p /etc/check_net
cp -a ${base_dir}/${network}/check_net /etc/
if [ "$?" != "0" ]; then
_rval=false
fi
else
if [[ -d "/etc/check_net" ]]; then
rm -rf /etc/check_net
fi
fi
if [ -f ${base_dir}/${network}/check_net.service.${_network} ] ; then
cp -a ${base_dir}/${network}/check_net.service.${_network} /etc/systemd/system/check_net.service
if [ "$?" != "0" ]; then
_rval=false
fi
systemctl daemon-reload
systemctl enable check_net.service
if [ "$?" != "0" ]; then
_rval=false
fi
cp -a ${base_dir}/${network}/check_net.sh.${_network} /usr/local/sbin/check_net/check_net.sh
if [ "$?" != "0" ]; then
_rval=false
fi
cp -a ${base_dir}/${network}/netconfig.sh.${_network} /usr/local/sbin/check_net/netconfig.sh
if [ "$?" != "0" ]; then
_rval=false
fi
cp -a ${base_dir}/${network}/check_net.conf.${_network} /etc/check_net/check_net.conf
if [ "$?" != "0" ]; then
_rval=false
fi
mkdir -p /etc/check_net
if [ "$?" != "0" ]; then
_rval=false
else
if [[ -f "/etc/systemd/system/check_net.service" ]]; then
systemctl disable check_net.service
rm /etc/systemd/system/check_net.service
systemctl daemon-reload
fi
fi
if [[ -f "${base_dir}/${network}/check_net-logrotate.${_network}" ]]; then
cp -a ${base_dir}/${network}/check_net-logrotate.${_network} /etc/logrotated.d/check_net
if [ "$?" != "0" ]; then
_rval=false
fi
if ! $_rval ; then
echo_FAILED
else
echo_OK
else
if [[ -f "/etc/logrotated.d/check_net" ]]; then
rm /etc/logrotated.d/check_net
fi
fi
if ! $_rval ; then
echo_FAILED
else
echo_OK
fi
# - Other files
# -
#if $_igmproxy ; then
if [ -f ${base_dir}/${network}/igmpproxy.conf.${network} ];then
echo -en "\tConfigure igmproxy (Entertain TV).."
PID=`ps aux | grep "/igmpproxy " | grep -v grep | awk '{print$2}'`
@ -528,7 +628,7 @@ else
fi
echo -en "\tSetting up rc.local.."
if [ "$network" = "NONE-CKUBU" -o "$network" = "NONE-WF" ];then
if [ "$network" = "NONE-CKUBU" -o "$network" = "NONE-WF" -o "$network" = "GA-Ersatz" ];then
cp -a ${base_dir}/rc.local.NONE /etc/rc.local
else
#cp -a ${base_dir}/rc.local /etc/rc.local

View File

@ -63,13 +63,17 @@ mkdir -p ${homedir_user}/${_dir}
# - Nameserver Bind
# - /etc/bind/*
# -
tar -czpf ${homedir_user}/${_dir}/bind_${_network}.tar.gz -C ${filesystem_prefix}/etc bind
chown ${user}:${user} ${homedir_user}/${_dir}/bind_${_network}.tar.gz
if [[ "$(ls -A /usr/local/src)" ]] ; then
tar -czpf ${homedir_user}/${_dir}/bind_${_network}.tar.gz -C ${filesystem_prefix}/etc bind
chown ${user}:${user} ${homedir_user}/${_dir}/bind_${_network}.tar.gz
fi
# - OpenVPN:
# - /etc/openvpn/*
# -
# - /root/.openvpn
# -
if [[ -d "${filesystem_prefix}/etc/openvpn" ]]; then
tar -czpf ${homedir_user}/${_dir}/openvpn_${_network}.tar.gz -C ${filesystem_prefix}/etc openvpn
chown ${user}:${user} ${homedir_user}/${_dir}/openvpn_${_network}.tar.gz
@ -88,6 +92,14 @@ fi
# - DHCP Server
# -
# - /etc/dhcp/dhcpd.conf - /etc/dhcp3/dhcpd.conf
# - /etc/dhcp/dhcpd6.conf - /etc/dhcp3/dhcpd6.conf
# -
# - /etc/dhcp/hosts.lan.conf # dhcp failover kanzlei kiel
# - /etc/dhcp/hosts.w-lan.conf # dhcp failover kanzlei kiel
# -
# - /etc/init.d/isc-dhcp6-server
# -
if [ -f "${filesystem_prefix}/etc/dhcp/dhcpd.conf" ];then
cp ${filesystem_prefix}/etc/dhcp/dhcpd.conf ${homedir_user}/${_dir}/dhcpd.conf.${_network}
fi
@ -103,15 +115,25 @@ fi
if [ -f "${filesystem_prefix}/etc/init.d/isc-dhcp6-server" ]; then
cp ${filesystem_prefix}/etc/init.d/isc-dhcp6-server ${homedir_user}/${_dir}/isc-dhcp6-server.${_network}
fi
if [ -f "${filesystem_prefix}/etc/dhcp/hosts.lan.conf" ]; then
cp ${filesystem_prefix}/etc/dhcp/hosts.lan.conf ${homedir_user}/${_dir}/hosts.lan.conf.${_network}
fi
if [ -f "${filesystem_prefix}/etc/dhcp/hosts.w-lan.conf" ]; then
cp ${filesystem_prefix}/etc/dhcp/hosts.w-lan.conf ${homedir_user}/${_dir}/hosts.w-lan.conf.${_network}
fi
# - DSL PPP
# -
if [ -f "${filesystem_prefix}/etc/ppp/peers/dsl-provider" ]; then
cp ${filesystem_prefix}/etc/ppp/peers/dsl-provider ${homedir_user}/${_dir}/dsl-provider.${_network}
fi
_network_name=`echo ${_network} | tr '[:upper:]' '[:lower:]'`
if [ -f "${filesystem_prefix}/etc/ppp/peers/dsl-$_network_name" ];then
cp ${filesystem_prefix}/etc/ppp/peers/dsl-$_network_name ${homedir_user}/${_dir}/dsl-${_network_name}.${_network}
# - /etc/ppp/peers/*
# -
# - /etc/ppp/pap-secrets
# - /etc/ppp/chap-secrets
# -
# - /etc/ppp/ip-up.d/email_notice
# -
if [[ "$(ls -A /etc/ppp/peers)" ]] ; then
tar -czpf ${homedir_user}/${_dir}/etc_ppp_peers_${_network}.tar.gz -C ${filesystem_prefix}/etc/ppp/ peers
chown ${user}:${user} ${homedir_user}/${_dir}/etc_ppp_peers_${_network}.tar.gz
fi
cp ${filesystem_prefix}/etc/ppp/pap-secrets ${homedir_user}/${_dir}/pap-secrets.${_network}
cp ${filesystem_prefix}/etc/ppp/chap-secrets ${homedir_user}/${_dir}/chap-secrets.${_network}
@ -146,18 +168,50 @@ cp ${filesystem_prefix}/etc/hosts ${homedir_user}/${_dir}/hosts.${_network}
cp ${filesystem_prefix}/etc/network/interfaces ${homedir_user}/${_dir}/interfaces.${_network}
cp ${filesystem_prefix}/etc/resolv.conf ${homedir_user}/${_dir}/resolv.conf.${_network}
# - /root/bin directory
# -
if [[ "$(ls -A /root/bin)" ]] ; then
tar -czpf ${homedir_user}/${_dir}/root_bin_${_network}.tar.gz -C ${filesystem_prefix}/root bin
chown ${user}:${user} ${homedir_user}/${_dir}/root_bin_${_network}.tar.gz
fi
# - /usr/local/src directory
# -
if [[ "$(ls -A /usr/local/src)" ]] ; then
tar -czpf ${homedir_user}/${_dir}/usr_local_src_${_network}.tar.gz -C ${filesystem_prefix}/usr/local src
chown ${user}:${user} ${homedir_user}/${_dir}/usr_local_src_${_network}.tar.gz
fi
# - /usr/local/sbin directory
# -
if [[ "$(ls -A /usr/local/sbin)" ]] ; then
tar -czpf ${homedir_user}/${_dir}/usr_local_sbin_${_network}.tar.gz -C ${filesystem_prefix}/usr/local sbin
chown ${user}:${user} ${homedir_user}/${_dir}/usr_local_sbin_${_network}.tar.gz
fi
# - Firewall
# -
# - /etc/systemd/system/ipt-firewall.service
# - /etc/systemd/system/ip6t-firewall.service
# -
# - /etc/init.d/ipt-firewall
# - /etc/init.d/ipt-firewall
# -
# - /etc/ipt-firewall/*
# -
if [[ "$(ls -A /etc/ipt-firewall)" ]] ; then
tar -czpf ${homedir_user}/${_dir}/etc_ipt-firewall_${_network}.tar.gz -C ${filesystem_prefix}/etc ipt-firewall
chown ${user}:${user} ${homedir_user}/${_dir}/etc_ipt-firewall_${_network}.tar.gz
fi
if [[ -f "${filesystem_prefix}/etc/systemd/system/ipt-firewall.service" ]]; then
cp ${filesystem_prefix}/etc/systemd/system/ipt-firewall.service ${homedir_user}/${_dir}/ipt-firewall.service.${_network}
cp ${filesystem_prefix}/usr/local/sbin/ipt-firewall-gateway ${homedir_user}/${_dir}/ipt-firewall-gateway.${_network}
cp ${filesystem_prefix}/etc/ipt-firewall/ipt-firewall-gateway.conf ${homedir_user}/${_dir}/ipt-firewall-gateway.conf.${_network}
fi
if [[ -f "${filesystem_prefix}/etc/systemd/system/ip6t-firewall.service" ]]; then
cp ${filesystem_prefix}/etc/systemd/system/ipt-firewall.service ${homedir_user}/${_dir}/ip6t-firewall.service.${_network}
cp ${filesystem_prefix}/usr/local/sbin/ip6t-firewall-gateway ${homedir_user}/${_dir}/ip6t-firewall-gateway.${_network}
cp ${filesystem_prefix}/etc/ipt-firewall/ip6t-firewall-gateway.conf ${homedir_user}/${_dir}/ip6t-firewall-gateway.conf.${_network}
cp ${filesystem_prefix}/etc/systemd/system/ip6t-firewall.service ${homedir_user}/${_dir}/ip6t-firewall.service.${_network}
fi
if [ -f "${filesystem_prefix}/etc/init.d/ipt-firewall" ]; then
cp ${filesystem_prefix}/etc/init.d/ipt-firewall ${homedir_user}/${_dir}/ipt-firewall.${_network}
fi
@ -165,20 +219,47 @@ if [ -f "${filesystem_prefix}/etc/init.d/ip6t-firewall" ]; then
cp ${filesystem_prefix}/etc/init.d/ip6t-firewall ${homedir_user}/${_dir}/ip6t-firewall.${_network}
fi
if [ -f "${filesystem_prefix}/etc/init.d/ipt-firewall-gateway" ]; then
cp ${filesystem_prefix}/etc/init.d/ipt-firewall-gateway ${homedir_user}/${_dir}/ipt-firewall-gateway.${_network}
fi
if [ -f "${filesystem_prefix}/etc/init.d/ip6t-firewall-gateway" ]; then
cp ${filesystem_prefix}/etc/init.d/ip6t-firewall-gateway ${homedir_user}/${_dir}/ip6t-firewall-gateway.${_network}
fi
# - Check Script Onlinestatus
# -
# - /etc/systemd/system/check_net.service
# -
# - /usr/local/sbin/check_net.sh
# - /usr/local/sbin/netconfig.sh
# -
# - /etc/check_net/*
# -
# - /etc/logrotate.d/check_net
# -
if [[ "$(ls -A /etc/check_net)" ]] ; then
tar -czpf ${homedir_user}/${_dir}/etc_check_net_${_network}.tar.gz -C ${filesystem_prefix}/etc check_net
chown ${user}:${user} ${homedir_user}/${_dir}/etc_check_net_${_network}.tar.gz
fi
if [[ -f "${filesystem_prefix}/etc/systemd/system/check_net.service" ]] ; then
cp ${filesystem_prefix}/etc/systemd/system/check_net.service ${homedir_user}/${_dir}/check_net.service.${_network}
cp ${filesystem_prefix}/usr/local/sbin/check_net.sh ${homedir_user}/${_dir}/check_net.sh.${_network}
cp ${filesystem_prefix}/usr/local/sbin/netconfig.sh ${homedir_user}/${_dir}/netconfig.sh.${_network}
cp ${filesystem_prefix}/etc/check_net/check_net.conf ${homedir_user}/${_dir}/check_net.conf.${_network}
fi
if [[ -f "${filesystem_prefix}/etc/logrotate.d/check_net" ]] ; then
cp ${filesystem_prefix}/etc/logrotate.d/check_net ${homedir_user}/${_dir}/check_net-logrotate.${_network}
fi
cp ${filesystem_prefix}/etc/rc.local ${homedir_user}/${_dir}/rc.local.${_network}
# - Other files
# -
# - /etc/rc.local
# - /var/spool/cron/crontabs/root
# - /usr/local/igmpproxy/etc/igmpproxy.conf
# - /etc/aiccu.conf
# - /etc/default/aiccu
# - /etc/radvd.conf
# -
if [ -f "${filesystem_prefix}/etc/rc.local" ]; then
cp ${filesystem_prefix}/etc/rc.local ${homedir_user}/${_dir}/rc.local.${_network}
fi
if [ -f "${filesystem_prefix}/var/spool/cron/crontabs/root" ]; then
cp ${filesystem_prefix}/var/spool/cron/crontabs/root ${homedir_user}/${_dir}/cron_root.${_network}
fi

View File

@ -40,6 +40,28 @@ exit
}
manage_files() {
for file in $* ; do
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/$file ] ; then
scp -o User=$remote_user ${remote_host}:${_network}-config/$file .
ssh -l $remote_user ${remote_host} "rm ${_network}-config/$file"
fi
done
}
manage_archives() {
for archive in $* ; do
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/$archive" ]; then
scp -o User=$remote_user ${remote_host}:${_network}-config/$archive .
gunzip < $archive | tar -xpf -
rm -f $archive
ssh -l $remote_user ${remote_host} "rm ${_network}-config/$archive"
fi
done
}
while getopts h:u: opt ; do
case $opt in
h) remote_host="$OPTARG"
@ -70,232 +92,152 @@ office_dir=${office_base_dir}/${_network}
mkdir -p $office_dir
cd $office_dir
# - Nameserver Bind
# - /etc/bind/*
# -
manage_archives bind_${_network}.tar.gz
# - OpenVPN:
# - /etc/openvpn/*
# -
# - /root/.openvpn
# -
archives="openvpn_${_network}.tar.gz
root-dot-opennvpndir_${_network}.tar.gz"
manage_archives $archives
scp -o User=$remote_user ${remote_host}:${_network}-config/bind_${_network}.tar.gz .
gunzip < bind_${_network}.tar.gz | tar -xpf -
rm -f bind_${_network}.tar.gz
# - DynDNS
# -
# - /etc/ddclient.conf
# -
manage_files ddclient.conf.${_network}
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/openvpn_${_network}.tar.gz" ]; then
scp -o User=$remote_user ${remote_host}:${_network}-config/openvpn_${_network}.tar.gz .
gunzip < openvpn_${_network}.tar.gz | tar -xpf -
rm -f openvpn_${_network}.tar.gz
fi
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/root-dot-opennvpndir_${_network}.tar.gz" ] ; then
scp -o User=$remote_user ${remote_host}:${_network}-config/root-dot-opennvpndir_${_network}.tar.gz .
gunzip < root-dot-opennvpndir_${_network}.tar.gz | tar -xpf -
rm -f root-dot-opennvpndir_${_network}.tar.gz
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/ddclient.conf.${_network} ] ; then
scp -o User=$remote_user ${remote_host}:${_network}-config/ddclient.conf.${_network} .
fi
scp -o User=$remote_user ${remote_host}:${_network}-config/dhcpd.conf.${_network} .
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/dhcpd6.conf.${_network} ] ; then
scp -o User=$remote_user ${remote_host}:${_network}-config/dhcpd6.conf.${_network} .
fi
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/isc-dhcp6-server.${_network}" ]; then
scp -o User=$remote_user ${remote_host}:${_network}-config/isc-dhcp6-server.${_network} .
fi
# - DHCP Server
# -
# - /etc/dhcp/dhcpd.conf - /etc/dhcp3/dhcpd.conf
# - /etc/dhcp/dhcpd6.conf - /etc/dhcp3/dhcpd6.conf
# -
# - hosts.lan.conf # dhcp failover kanzlei kiel
# - hosts.w-lan.conf # dhcp failover kanzlei kiel
# -
# - /etc/init.d/isc-dhcp6-server
# -
files="dhcpd.conf.${_network}
dhcpd6.conf.${_network}
isc-dhcp6-server.${_network}
hosts.lan.conf.${_network}
hosts.w-lan.conf.${_network}"
manage_files "$files"
# - DSL PPP
# -
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/dsl-provider.${_network}" ]; then
scp -o User=$remote_user ${remote_host}:${_network}-config/dsl-provider.${_network} .
fi
_network_name=`echo $_network | tr '[:upper:]' '[:lower:]'`
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/dsl-${_network_name}.${_network} ] ; then
scp -o User=$remote_user ${remote_host}:${_network}-config/dsl-${_network_name}.${_network} .
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/pap-secrets.${_network} ] ; then
scp -o User=$remote_user ${remote_host}:${_network}-config/pap-secrets.${_network} .
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/chap-secrets.${_network} ] ; then
scp -o User=$remote_user ${remote_host}:${_network}-config/chap-secrets.${_network} .
fi
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/email_notice.${_network}" ]; then
scp -o User=$remote_user ${remote_host}:${_network}-config/email_notice.${_network} .
fi
# - /etc/ppp/peers/*
# -
# - /etc/ppp/pap-secrets
# - /etc/ppp/chap-secrets
# -
# - /etc/ppp/ip-up.d/email_notice
# -
manage_files pap-secrets.${_network} chap-secrets.${_network} email_notice.${_network}
manage_archives etc_ppp_peers_${_network}.tar.gz
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/generic.${_network} ] ; then
scp -o User=$remote_user ${remote_host}:${_network}-config/generic.${_network} .
scp -o User=$remote_user ${remote_host}:${_network}-config/generic.db.${_network} .
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/sasl_passwd.${_network} ] ; then
scp -o User=$remote_user ${remote_host}:${_network}-config/sasl_passwd.${_network} .
scp -o User=$remote_user ${remote_host}:${_network}-config/sasl_passwd.db.${_network} .
fi
scp -o User=$remote_user ${remote_host}:${_network}-config/mailname.${_network} .
scp -o User=$remote_user ${remote_host}:${_network}-config/main.cf.${_network} .
# - Postfix SMTP
# -
# - /etc/postfix/main.cf
# - /etc/mailname
# - /etc/postfix/generic
# - /etc/postfix/generic.db
# - /etc/postfix/sasl_passwd
# - /etc/postfix/sasl_passwd.db
# -
files="main.cf.${_network}
mailname.${_network}
sasl_passwd.${_network}
sasl_passwd.db.${_network}
generic.${_network}
generic.db.${_network}"
manage_files $files
# - Netzwerk:
# - /etc/hostname
# - /etc/hosts
# - /etc/network/interfaces
# - /etc/resolv.conf
files="hostname.${_network}
hosts.${_network}
interfaces.${_network}
resolv.conf.${_network}"
manage_files $files
# - /root/bin directory
# -
manage_archives root_bin_${_network}.tar.gz
# - /usr/local/src directory
# -
manage_archives usr_local_src_${_network}.tar.gz
# - /usr/local/sbin directory
# -
manage_archives usr_local_sbin_${_network}.tar.gz
scp -o User=$remote_user ${remote_host}:${_network}-config/hostname.${_network} .
scp -o User=$remote_user ${remote_host}:${_network}-config/hosts.${_network} .
scp -o User=$remote_user ${remote_host}:${_network}-config/interfaces.${_network} .
scp -o User=$remote_user ${remote_host}:${_network}-config/rc.local.${_network} .
# - Firewall
# -
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/ipt-firewall.service.${_network}" ]; then
scp -o User=$remote_user ${remote_host}:${_network}-config/ipt-firewall.service.${_network} .
scp -o User=$remote_user ${remote_host}:${_network}-config/ipt-firewall-gateway.${_network} .
scp -o User=$remote_user ${remote_host}:${_network}-config/ipt-firewall-gateway.conf.${_network} .
fi
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/ip6t-firewall.service.${_network}" ]; then
scp -o User=$remote_user ${remote_host}:${_network}-config/ip6t-firewall.service.${_network} .
scp -o User=$remote_user ${remote_host}:${_network}-config/ip6t-firewall-gateway.${_network} .
scp -o User=$remote_user ${remote_host}:${_network}-config/ip6t-firewall-gateway.conf.${_network} .
fi
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/ipt-firewall.${_network}" ]; then
scp -o User=$remote_user ${remote_host}:${_network}-config/ipt-firewall.${_network} .
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/ip6t-firewall.${_network} ] ; then
scp -o User=$remote_user ${remote_host}:${_network}-config/ip6t-firewall.${_network} .
fi
# - /etc/systemd/system/ipt-firewall.service
# - /etc/systemd/system/ip6t-firewall.service
# -
# - /etc/init.d/ipt-firewall
# - /etc/init.d/ipt-firewall
# -
# - /etc/ipt-firewall/*
# -
manage_archives etc_ipt-firewall_${_network}.tar.gz
files="ipt-firewall.service.${_network}
ip6t-firewall.service.${_network}
ipt-firewall.${_network}
ip6t-firewall.${_network}
ipt-firewall-gateway.${_network}
ip6t-firewall-gateway.${_network}"
manage_files $files
# - Check Script Onlinestatus
# -
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/check_net.service.${_network}" ]; then
scp -o User=$remote_user ${remote_host}:${_network}-config/check_net.service.${_network} .
scp -o User=$remote_user ${remote_host}:${_network}-config/check_net.sh.${_network} .
scp -o User=$remote_user ${remote_host}:${_network}-config/netconfig.sh.${_network} .
scp -o User=$remote_user ${remote_host}:${_network}-config/check_net.conf.${_network} .
fi
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/check_net-logrotate.${_network}" ]; then
scp -o User=$remote_user ${remote_host}:${_network}-config/check_net-logrotate.${_network} .
fi
scp -o User=$remote_user ${remote_host}:${_network}-config/resolv.conf.${_network} .
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/cron_root.${_network} ];then
scp -o User=$remote_user ${remote_host}:${_network}-config/cron_root.${_network} .
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/igmpproxy.conf.${_network} ] ; then
scp -o User=$remote_user ${remote_host}:${_network}-config/igmpproxy.conf.${_network} .
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/aiccu.conf.${_network} ] ; then
scp -o User=$remote_user ${remote_host}:${_network}-config/aiccu.conf.${_network} .
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/aiccu.${_network} ] ; then
scp -o User=$remote_user ${remote_host}:${_network}-config/aiccu.${_network} .
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/radvd.conf.${_network} ] ; then
scp -o User=$remote_user ${remote_host}:${_network}-config/radvd.conf.${_network} .
fi
ssh -l $remote_user ${remote_host} "rm ${_network}-config/bind_${_network}.tar.gz"
ssh -l $remote_user ${remote_host} "rm ${_network}-config/openvpn_${_network}.tar.gz"
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/root-dot-opennvpndir_${_network}.tar.gz ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/root-dot-opennvpndir_${_network}.tar.gz"
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/ddclient.conf.${_network} ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/ddclient.conf.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/dhcpd.conf.${_network}" ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/dhcpd.conf.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/dhcpd6.conf.${_network} ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/dhcpd6.conf.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/isc-dhcp6-server.${_network}" ]; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/isc-dhcp6-server.${_network}"
fi
# - DSL PPP
# - /etc/systemd/system/check_net.service
# -
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/dsl-provider.${_network}" ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/dsl-provider.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/dsl-${_network_name}.${_network}" ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/dsl-${_network_name}.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/pap-secrets.${_network} ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/pap-secrets.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/chap-secrets.${_network} ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/chap-secrets.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/email_notice.${_network}" ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/email_notice.${_network}"
fi
# - Postfix
# - /usr/local/sbin/check_net.sh
# - /usr/local/sbin/netconfig.sh
# -
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/generic.${_network} ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/generic.${_network}"
ssh -l $remote_user ${remote_host} "rm ${_network}-config/generic.db.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/sasl_passwd.${_network} ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/sasl_passwd.${_network}"
ssh -l $remote_user ${remote_host} "rm ${_network}-config/sasl_passwd.db.${_network}"
fi
ssh -l $remote_user ${remote_host} "rm ${_network}-config/mailname.${_network}"
ssh -l $remote_user ${remote_host} "rm ${_network}-config/main.cf.${_network}"
ssh -l $remote_user ${remote_host} "rm ${_network}-config/hostname.${_network}"
ssh -l $remote_user ${remote_host} "rm ${_network}-config/hosts.${_network}"
ssh -l $remote_user ${remote_host} "rm ${_network}-config/interfaces.${_network}"
ssh -l $remote_user ${remote_host} "rm ${_network}-config/rc.local.${_network}"
# - Firewall
# - /etc/check_net/*
# -
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/ipt-firewall.service.${_network}" ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/ipt-firewall.service.${_network}"
ssh -l $remote_user ${remote_host} "rm ${_network}-config/ipt-firewall-gateway.${_network}"
ssh -l $remote_user ${remote_host} "rm ${_network}-config/ipt-firewall-gateway.conf.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/ip6t-firewall.service.${_network}" ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/ip6t-firewall.service.${_network}"
ssh -l $remote_user ${remote_host} "rm ${_network}-config/ip6t-firewall-gateway.${_network}"
ssh -l $remote_user ${remote_host} "rm ${_network}-config/ip6t-firewall-gateway.conf.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/ipt-firewall.${_network}" ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/ipt-firewall.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/ip6t-firewall.${_network} ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/ip6t-firewall.${_network}"
fi
# - Check Script Onlinestatus
# - /etc/logrotate.d/check_net
# -
manage_archives etc_check_net_${_network}.tar.gz
files="check_net.service.${_network}
check_net-logrotate.${_network}"
manage_files $files
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/check_net.service.${_network}" ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/check_net.service.${_network}"
ssh -l $remote_user ${remote_host} "rm ${_network}-config/check_net.sh.${_network}"
ssh -l $remote_user ${remote_host} "rm ${_network}-config/netconfig.sh.${_network}"
ssh -l $remote_user ${remote_host} "rm ${_network}-config/check_net.conf.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/check_net-logrotate.${_network}" ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/check_net-logrotate.${_network}"
fi
ssh -l $remote_user ${remote_host} "rm ${_network}-config/resolv.conf.${_network}"
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/cron_root.${_network} ]; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/cron_root.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/igmpproxy.conf.${_network} ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/igmpproxy.conf.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/aiccu.conf.${_network} ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/aiccu.conf.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/aiccu.${_network} ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/aiccu.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/radvd.conf.${_network} ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/radvd.conf.${_network}"
fi
# - Other
# -
# - /etc/rc.local
# - /var/spool/cron/crontabs/root
# - /usr/local/igmpproxy/etc/igmpproxy.conf
# - /etc/aiccu.conf
# - /etc/default/aiccu
# - /etc/radvd.conf
# -
files="rc.local.${_network}
cron_root.${_network}
igmpproxy.conf.${_network}
aiccu.conf.${_network}
aiccu.${_network}
radvd.conf.${_network}"
manage_files $files
@ -328,6 +270,173 @@ cat $office_dir/README.txt
exit 0
# ---
# - Delete remote files
# ----
# - Bind
# -
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/bind_${_network}.tar.gz" ]; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/bind_${_network}.tar.gz"
fi
# - OpenVPN
# -
#if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/openvpn_${_network}.tar.gz" ]; then
# ssh -l $remote_user ${remote_host} "rm ${_network}-config/openvpn_${_network}.tar.gz"
#fi
#if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/root-dot-opennvpndir_${_network}.tar.gz ] ; then
# ssh -l $remote_user ${remote_host} "rm ${_network}-config/root-dot-opennvpndir_${_network}.tar.gz"
#fi
# - DynDNS
# -
#if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/ddclient.conf.${_network} ] ; then
# ssh -l $remote_user ${remote_host} "rm ${_network}-config/ddclient.conf.${_network}"
#fi
# - DHCP Server
# -
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/dhcpd.conf.${_network}" ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/dhcpd.conf.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/dhcpd6.conf.${_network} ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/dhcpd6.conf.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/isc-dhcp6-server.${_network}" ]; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/isc-dhcp6-server.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/hosts.lan.conf.${_network}" ]; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/hosts.lan.conf.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/hosts.w-lan.conf.${_network}" ]; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/hosts.w-lan.conf.${_network}"
fi
# - DSL PPP
# -
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/etc_ppp_peers_${_network}.tar.gz" ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/etc_ppp_peers_${_network}.tar.gz"
fi
#if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/dsl-provider.${_network}" ] ; then
# ssh -l $remote_user ${remote_host} "rm ${_network}-config/dsl-provider.${_network}"
#fi
#if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/dsl-${_network_name}.${_network}" ] ; then
# ssh -l $remote_user ${remote_host} "rm ${_network}-config/dsl-${_network_name}.${_network}"
#fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/pap-secrets.${_network} ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/pap-secrets.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/chap-secrets.${_network} ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/chap-secrets.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/email_notice.${_network}" ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/email_notice.${_network}"
fi
# - Postfix
# -
ssh -l $remote_user ${remote_host} "rm ${_network}-config/main.cf.${_network}"
ssh -l $remote_user ${remote_host} "rm ${_network}-config/mailname.${_network}"
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/sasl_passwd.${_network} ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/sasl_passwd.${_network}"
ssh -l $remote_user ${remote_host} "rm ${_network}-config/sasl_passwd.db.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/generic.${_network} ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/generic.${_network}"
ssh -l $remote_user ${remote_host} "rm ${_network}-config/generic.db.${_network}"
fi
# - Netzwerk
# -
ssh -l $remote_user ${remote_host} "rm ${_network}-config/hostname.${_network}"
ssh -l $remote_user ${remote_host} "rm ${_network}-config/hosts.${_network}"
ssh -l $remote_user ${remote_host} "rm ${_network}-config/interfaces.${_network}"
ssh -l $remote_user ${remote_host} "rm ${_network}-config/resolv.conf.${_network}"
ssh -l $remote_user ${remote_host} "rm ${_network}-config/rc.local.${_network}"
# - /root/bin directory
# -
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/root_bin_${_network}.tar.gz" ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/root_bin_${_network}.tar.gz"
fi
# - /usr/local/src directory
# -
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/usr_local_src_${_network}.tar.gz" ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/usr_local_src_${_network}.tar.gz"
fi
# - /usr/local/sbin directory
# -
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/usr_local_sbin_${_network}.tar.gz" ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/usr_local_sbin_${_network}.tar.gz"
fi
# - Firewall
# -
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/etc_ipt-firewall_${_network}.tar.gz" ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/etc_ipt-firewall_${_network}.tar.gz"
fi
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/ipt-firewall.service.${_network}" ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/ipt-firewall.service.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/ip6t-firewall.service.${_network}" ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/ip6t-firewall.service.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/ipt-firewall.${_network}" ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/ipt-firewall.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/ip6t-firewall.${_network} ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/ip6t-firewall.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/ipt-firewall-gateway.${_network}" ]; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/ipt-firewall-gateway.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/ip6t-firewall-gateway.${_network}" ]; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/ipt-firewall-gateway.${_network}"
fi
# - Check Script Onlinestatus
# -
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/etc_check_net_${_network}.tar.gz" ]; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/etc_check_net_${_network}.tar.gz"
fi
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/check_net.service.${_network}" ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/check_net.service.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/check_net-logrotate.${_network}" ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/check_net-logrotate.${_network}"
fi
# - Other
# -
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/cron_root.${_network} ]; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/cron_root.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/igmpproxy.conf.${_network} ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/igmpproxy.conf.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/aiccu.conf.${_network} ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/aiccu.conf.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/aiccu.${_network} ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/aiccu.${_network}"
fi
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/radvd.conf.${_network} ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/radvd.conf.${_network}"
fi
# ----------
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/" ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/"
fi