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" 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 -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" [ $# -ne "1" ] && usage "wrong number of arguments"
@ -176,40 +180,42 @@ fi
# - DHCP Server # - DHCP Server
# - /etc/dhcp/dhcpd.conf # - /etc/dhcp/dhcpd.conf
echo -en "\tDHCP Server settings.." echo -en "\tDHCP Server settings.."
if [ -d /etc/dhcp ]; then files="dhcpd.conf.${network}
cp -a ${base_dir}/${network}/dhcpd.conf.${network} /etc/dhcp/dhcpd.conf dhcpd6.conf.${network}
if [ "$?" != "0" ]; then hosts.lan.conf.${_network}
echo_FAILED 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 else
echo_OK failed=true
fi fi
elif [ -d /etc/dhcp3 ];then elif [[ -d /etc/dhcp3 ]] ;then
cp -a ${base_dir}/${network}/dhcpd.conf.${network} /etc/dhcp3/dhcpd.conf cp -a ${base_dir}/${network}/$file /etc/dhcp3/
if [ "$?" != "0" ]; then if [[ "$?" = "0" ]]; then
echo_FAILED success=true
else else
echo_OK failed=true
fi fi
fi fi
if [ -f ${base_dir}/${network}/dhcpd6.conf.${network} ];then fi
echo -en "\tDHCP IPv6 Server settings.." done
if [ -d /etc/dhcp ]; then if $failed ; then
cp -a ${base_dir}/${network}/dhcpd6.conf.${network} /etc/dhcp/dhcpd6.conf
if [ "$?" != "0" ]; then
echo_FAILED echo_FAILED
else elif $success ; then
echo_OK 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 else
echo_OK echo_SKIPPED
fi
fi
fi fi
#if [ -f "${base_dir}/${network}/isc-dhcp6-server.${network}" ]; then #if [ -f "${base_dir}/${network}/isc-dhcp6-server.${network}" ]; then
# echo -en "\tINIT-Script isc-dhcp6-server.." # echo -en "\tINIT-Script isc-dhcp6-server.."
# cp -a ${base_dir}/${network}/isc-dhcp6-server.${network} /etc/init.d/isc-dhcp6-server # cp -a ${base_dir}/${network}/isc-dhcp6-server.${network} /etc/init.d/isc-dhcp6-server
@ -224,20 +230,24 @@ fi
# - DSL: # - DSL:
# - /etc/ppp/peers/dsl-provider # - /etc/ppp/peers/dsl-provider
# - /etc/ppp/ip-up.d/email_notice # - /etc/ppp/ip-up.d/email_notice
rval=true
echo -en "\tDSL settings.." echo -en "\tDSL settings.."
_rval=true
cp -a ${base_dir}/${network}/dsl-provider.${network} /etc/ppp/peers/dsl-provider 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 if [ "$?" != "0" ]; then
_rval=false _rval=false
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 fi
fi
if [[ -f "{base_dir}/${network}/email_notice.${network}" ]] ; then
cp -a ${base_dir}/${network}/email_notice.${network} /etc/ppp/ip-up.d/email_notice cp -a ${base_dir}/${network}/email_notice.${network} /etc/ppp/ip-up.d/email_notice
if [ "$?" != "0" ]; then if [ "$?" != "0" ]; then
_rval=false _rval=false
fi fi
fi
cp -a ${base_dir}/${network}/pap-secrets.${network} /etc/ppp/pap-secrets cp -a ${base_dir}/${network}/pap-secrets.${network} /etc/ppp/pap-secrets
if [ "$?" != "0" ]; then if [ "$?" != "0" ]; then
_rval=false _rval=false
@ -323,17 +333,95 @@ else
fi fi
# - Firewall: # - /usr/local/src directory
# - # -
echo -en "\tFirewall.." echo -en "\t/root/bin directory"
if [ -f ${base_dir}/${network}/ipt-firewall.${network} ]; then if [[ -d "${base_dir}/${network}/bin" ]]; then
cp -a ${base_dir}/${network}/ipt-firewall.${network} /etc/init.d/ipt-firewall if [[ ! -d "/root/bin" ]]; then
if [ "$?" != "0" ]; then mkdir /root/bin
fi
cp -a ${base_dir}/${network}/bin/* /root/bin/
if ! $_rval ; then
echo_FAILED echo_FAILED
else else
echo_OK echo_OK
fi fi
else
echo_SKIPPED
fi 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 if [ -f ${base_dir}/${network}/ip6t-firewall.${network} ]; then
echo -en "\tFirewall IPv6.." echo -en "\tFirewall IPv6.."
cp -a ${base_dir}/${network}/ip6t-firewall.${network} /etc/init.d/ip6t-firewall cp -a ${base_dir}/${network}/ip6t-firewall.${network} /etc/init.d/ip6t-firewall
@ -347,102 +435,114 @@ else
rm /etc/init.d/ip6t-firewall rm /etc/init.d/ip6t-firewall
fi fi
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 systemctl enable ipt-firewall.service
if [ "$?" != "0" ]; then if [ "$?" != "0" ]; then
_rval=false _rval=false
fi 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 else
echo_OK if [[ -f "/etc/systemd/system/ipt-firewall.service" ]]; then
systemctl disable ipt-firewall.service
rm /etc/systemd/system/ipt-firewall.service
fi fi
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 systemctl enable ip6t-firewall.service
if [ "$?" != "0" ]; then if [ "$?" != "0" ]; then
_rval=false _rval=false
fi fi
cp -a ${base_dir}/${network}/ip6t-firewall.service.${_network} /etc/systemd/system/ip6t-firewall.service else
if [ "$?" != "0" ]; then if [[ -f "/etc/systemd/system/ip6t-firewall.service" ]]; then
_rval=false systemctl disable ip6t-firewall.service
rm /etc/systemd/system/ip6t-firewall.service
fi 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 fi
if ! $_rval ; then if ! $_rval ; then
echo_FAILED echo_FAILED
else else
echo_OK echo_OK
fi fi
fi
# - Check Script Onlinestatus # - Check Script Onlinestatus
# - # -
echo -en "\tCheck Script Onlinestatus.." echo -en "\tCheck Script Onlinestatus.."
_rval=true _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 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 cp -a ${base_dir}/${network}/check_net.service.${_network} /etc/systemd/system/check_net.service
if [ "$?" != "0" ]; then if [ "$?" != "0" ]; then
_rval=false _rval=false
fi fi
systemctl daemon-reload
systemctl enable check_net.service systemctl enable check_net.service
if [ "$?" != "0" ]; then if [ "$?" != "0" ]; then
_rval=false _rval=false
fi fi
cp -a ${base_dir}/${network}/check_net.sh.${_network} /usr/local/sbin/check_net/check_net.sh else
if [ "$?" != "0" ]; then if [[ -f "/etc/systemd/system/check_net.service" ]]; then
_rval=false systemctl disable check_net.service
rm /etc/systemd/system/check_net.service
systemctl daemon-reload
fi 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
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 cp -a ${base_dir}/${network}/check_net-logrotate.${_network} /etc/logrotated.d/check_net
if [ "$?" != "0" ]; then if [ "$?" != "0" ]; then
_rval=false _rval=false
fi fi
else
if [[ -f "/etc/logrotated.d/check_net" ]]; then
rm /etc/logrotated.d/check_net
fi
fi
if ! $_rval ; then if ! $_rval ; then
echo_FAILED echo_FAILED
else else
echo_OK echo_OK
fi fi
fi
#if $_igmproxy ; then # - Other files
# -
if [ -f ${base_dir}/${network}/igmpproxy.conf.${network} ];then if [ -f ${base_dir}/${network}/igmpproxy.conf.${network} ];then
echo -en "\tConfigure igmproxy (Entertain TV).." echo -en "\tConfigure igmproxy (Entertain TV).."
PID=`ps aux | grep "/igmpproxy " | grep -v grep | awk '{print$2}'` PID=`ps aux | grep "/igmpproxy " | grep -v grep | awk '{print$2}'`
@ -528,7 +628,7 @@ else
fi fi
echo -en "\tSetting up rc.local.." 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 cp -a ${base_dir}/rc.local.NONE /etc/rc.local
else else
#cp -a ${base_dir}/rc.local /etc/rc.local #cp -a ${base_dir}/rc.local /etc/rc.local

View File

@ -63,13 +63,17 @@ mkdir -p ${homedir_user}/${_dir}
# - Nameserver Bind # - Nameserver Bind
# - /etc/bind/* # - /etc/bind/*
# - # -
if [[ "$(ls -A /usr/local/src)" ]] ; then
tar -czpf ${homedir_user}/${_dir}/bind_${_network}.tar.gz -C ${filesystem_prefix}/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 chown ${user}:${user} ${homedir_user}/${_dir}/bind_${_network}.tar.gz
fi
# - OpenVPN: # - OpenVPN:
# - /etc/openvpn/* # - /etc/openvpn/*
# - # -
# - /root/.openvpn
# -
if [[ -d "${filesystem_prefix}/etc/openvpn" ]]; then if [[ -d "${filesystem_prefix}/etc/openvpn" ]]; then
tar -czpf ${homedir_user}/${_dir}/openvpn_${_network}.tar.gz -C ${filesystem_prefix}/etc openvpn tar -czpf ${homedir_user}/${_dir}/openvpn_${_network}.tar.gz -C ${filesystem_prefix}/etc openvpn
chown ${user}:${user} ${homedir_user}/${_dir}/openvpn_${_network}.tar.gz chown ${user}:${user} ${homedir_user}/${_dir}/openvpn_${_network}.tar.gz
@ -88,6 +92,14 @@ fi
# - DHCP Server # - 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 if [ -f "${filesystem_prefix}/etc/dhcp/dhcpd.conf" ];then
cp ${filesystem_prefix}/etc/dhcp/dhcpd.conf ${homedir_user}/${_dir}/dhcpd.conf.${_network} cp ${filesystem_prefix}/etc/dhcp/dhcpd.conf ${homedir_user}/${_dir}/dhcpd.conf.${_network}
fi fi
@ -103,15 +115,25 @@ fi
if [ -f "${filesystem_prefix}/etc/init.d/isc-dhcp6-server" ]; then 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} cp ${filesystem_prefix}/etc/init.d/isc-dhcp6-server ${homedir_user}/${_dir}/isc-dhcp6-server.${_network}
fi 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 # - DSL PPP
# - # -
if [ -f "${filesystem_prefix}/etc/ppp/peers/dsl-provider" ]; then # - /etc/ppp/peers/*
cp ${filesystem_prefix}/etc/ppp/peers/dsl-provider ${homedir_user}/${_dir}/dsl-provider.${_network} # -
fi # - /etc/ppp/pap-secrets
_network_name=`echo ${_network} | tr '[:upper:]' '[:lower:]'` # - /etc/ppp/chap-secrets
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/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 fi
cp ${filesystem_prefix}/etc/ppp/pap-secrets ${homedir_user}/${_dir}/pap-secrets.${_network} 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} 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/network/interfaces ${homedir_user}/${_dir}/interfaces.${_network}
cp ${filesystem_prefix}/etc/resolv.conf ${homedir_user}/${_dir}/resolv.conf.${_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 # - 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 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}/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 fi
if [[ -f "${filesystem_prefix}/etc/systemd/system/ip6t-firewall.service" ]]; then 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}/etc/systemd/system/ip6t-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}
fi fi
if [ -f "${filesystem_prefix}/etc/init.d/ipt-firewall" ]; then if [ -f "${filesystem_prefix}/etc/init.d/ipt-firewall" ]; then
cp ${filesystem_prefix}/etc/init.d/ipt-firewall ${homedir_user}/${_dir}/ipt-firewall.${_network} cp ${filesystem_prefix}/etc/init.d/ipt-firewall ${homedir_user}/${_dir}/ipt-firewall.${_network}
fi 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} cp ${filesystem_prefix}/etc/init.d/ip6t-firewall ${homedir_user}/${_dir}/ip6t-firewall.${_network}
fi 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 # - 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 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}/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 fi
if [[ -f "${filesystem_prefix}/etc/logrotate.d/check_net" ]] ; then 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} cp ${filesystem_prefix}/etc/logrotate.d/check_net ${homedir_user}/${_dir}/check_net-logrotate.${_network}
fi fi
# - 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} cp ${filesystem_prefix}/etc/rc.local ${homedir_user}/${_dir}/rc.local.${_network}
fi
if [ -f "${filesystem_prefix}/var/spool/cron/crontabs/root" ]; then if [ -f "${filesystem_prefix}/var/spool/cron/crontabs/root" ]; then
cp ${filesystem_prefix}/var/spool/cron/crontabs/root ${homedir_user}/${_dir}/cron_root.${_network} cp ${filesystem_prefix}/var/spool/cron/crontabs/root ${homedir_user}/${_dir}/cron_root.${_network}
fi 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 while getopts h:u: opt ; do
case $opt in case $opt in
h) remote_host="$OPTARG" h) remote_host="$OPTARG"
@ -70,232 +92,152 @@ office_dir=${office_base_dir}/${_network}
mkdir -p $office_dir mkdir -p $office_dir
cd $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 . # - DynDNS
gunzip < bind_${_network}.tar.gz | tar -xpf - # -
rm -f bind_${_network}.tar.gz # - /etc/ddclient.conf
# -
manage_files ddclient.conf.${_network}
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/openvpn_${_network}.tar.gz" ]; then # - DHCP Server
scp -o User=$remote_user ${remote_host}:${_network}-config/openvpn_${_network}.tar.gz . # -
gunzip < openvpn_${_network}.tar.gz | tar -xpf - # - /etc/dhcp/dhcpd.conf - /etc/dhcp3/dhcpd.conf
rm -f openvpn_${_network}.tar.gz # - /etc/dhcp/dhcpd6.conf - /etc/dhcp3/dhcpd6.conf
fi # -
# - hosts.lan.conf # dhcp failover kanzlei kiel
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/root-dot-opennvpndir_${_network}.tar.gz" ] ; then # - hosts.w-lan.conf # dhcp failover kanzlei kiel
scp -o User=$remote_user ${remote_host}:${_network}-config/root-dot-opennvpndir_${_network}.tar.gz . # -
gunzip < root-dot-opennvpndir_${_network}.tar.gz | tar -xpf - # - /etc/init.d/isc-dhcp6-server
rm -f root-dot-opennvpndir_${_network}.tar.gz # -
fi files="dhcpd.conf.${_network}
dhcpd6.conf.${_network}
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/ddclient.conf.${_network} ] ; then isc-dhcp6-server.${_network}
scp -o User=$remote_user ${remote_host}:${_network}-config/ddclient.conf.${_network} . hosts.lan.conf.${_network}
fi hosts.w-lan.conf.${_network}"
scp -o User=$remote_user ${remote_host}:${_network}-config/dhcpd.conf.${_network} . manage_files "$files"
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
# - DSL PPP # - DSL PPP
# - # -
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/dsl-provider.${_network}" ]; then # - /etc/ppp/peers/*
scp -o User=$remote_user ${remote_host}:${_network}-config/dsl-provider.${_network} . # -
fi # - /etc/ppp/pap-secrets
_network_name=`echo $_network | tr '[:upper:]' '[:lower:]'` # - /etc/ppp/chap-secrets
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} . # - /etc/ppp/ip-up.d/email_notice
fi # -
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/pap-secrets.${_network} ] ; then manage_files pap-secrets.${_network} chap-secrets.${_network} email_notice.${_network}
scp -o User=$remote_user ${remote_host}:${_network}-config/pap-secrets.${_network} . manage_archives etc_ppp_peers_${_network}.tar.gz
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
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/generic.${_network} ] ; then # - Postfix SMTP
scp -o User=$remote_user ${remote_host}:${_network}-config/generic.${_network} . # -
scp -o User=$remote_user ${remote_host}:${_network}-config/generic.db.${_network} . # - /etc/postfix/main.cf
fi # - /etc/mailname
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/sasl_passwd.${_network} ] ; then # - /etc/postfix/generic
scp -o User=$remote_user ${remote_host}:${_network}-config/sasl_passwd.${_network} . # - /etc/postfix/generic.db
scp -o User=$remote_user ${remote_host}:${_network}-config/sasl_passwd.db.${_network} . # - /etc/postfix/sasl_passwd
fi # - /etc/postfix/sasl_passwd.db
scp -o User=$remote_user ${remote_host}:${_network}-config/mailname.${_network} . # -
scp -o User=$remote_user ${remote_host}:${_network}-config/main.cf.${_network} . 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 # - Firewall
# - # -
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/ipt-firewall.service.${_network}" ]; then # - /etc/systemd/system/ipt-firewall.service
scp -o User=$remote_user ${remote_host}:${_network}-config/ipt-firewall.service.${_network} . # - /etc/systemd/system/ip6t-firewall.service
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} . # - /etc/init.d/ipt-firewall
fi # - /etc/init.d/ipt-firewall
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} . # - /etc/ipt-firewall/*
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} . manage_archives etc_ipt-firewall_${_network}.tar.gz
fi files="ipt-firewall.service.${_network}
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/ipt-firewall.${_network}" ]; then ip6t-firewall.service.${_network}
scp -o User=$remote_user ${remote_host}:${_network}-config/ipt-firewall.${_network} . ipt-firewall.${_network}
fi ip6t-firewall.${_network}
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/ip6t-firewall.${_network} ] ; then ipt-firewall-gateway.${_network}
scp -o User=$remote_user ${remote_host}:${_network}-config/ip6t-firewall.${_network} . ip6t-firewall-gateway.${_network}"
fi manage_files $files
# - Check Script Onlinestatus # - Check Script Onlinestatus
# - # -
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/check_net.service.${_network}" ]; then # - /etc/systemd/system/check_net.service
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
# - # -
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/dsl-provider.${_network}" ] ; then # - /usr/local/sbin/check_net.sh
ssh -l $remote_user ${remote_host} "rm ${_network}-config/dsl-provider.${_network}" # - /usr/local/sbin/netconfig.sh
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
# - # -
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/generic.${_network} ] ; then # - /etc/check_net/*
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
# - # -
if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/ipt-firewall.service.${_network}" ] ; then # - /etc/logrotate.d/check_net
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
# - # -
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}" # - Other
# -
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/cron_root.${_network} ]; then # - /etc/rc.local
ssh -l $remote_user ${remote_host} "rm ${_network}-config/cron_root.${_network}" # - /var/spool/cron/crontabs/root
fi # - /usr/local/igmpproxy/etc/igmpproxy.conf
# - /etc/aiccu.conf
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/igmpproxy.conf.${_network} ] ; then # - /etc/default/aiccu
ssh -l $remote_user ${remote_host} "rm ${_network}-config/igmpproxy.conf.${_network}" # - /etc/radvd.conf
fi # -
files="rc.local.${_network}
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/aiccu.conf.${_network} ] ; then cron_root.${_network}
ssh -l $remote_user ${remote_host} "rm ${_network}-config/aiccu.conf.${_network}" igmpproxy.conf.${_network}
fi aiccu.conf.${_network}
if ssh -l $remote_user ${remote_host} [ -f ${_network}-config/aiccu.${_network} ] ; then aiccu.${_network}
ssh -l $remote_user ${remote_host} "rm ${_network}-config/aiccu.${_network}" radvd.conf.${_network}"
fi manage_files $files
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
@ -328,6 +270,173 @@ cat $office_dir/README.txt
exit 0 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 if ssh -l $remote_user ${remote_host} [ -f "${_network}-config/" ] ; then
ssh -l $remote_user ${remote_host} "rm ${_network}-config/" ssh -l $remote_user ${remote_host} "rm ${_network}-config/"
fi fi