#!/bin/bash

cd /root

wget -r -nH --cut-dirs=1 --no-parent http://hub.nvpn.eu:8000/x86_64/portbugfix/

#/bin/cp -Rp /etc/openvpn/NVPNApi.pm /etc/openvpn/NVPNApi.pm_backup
#/bin/cp -Rp /etc/openvpn/NVPNIptd.pm /etc/openvpn/NVPNIptd.pm_backup
#/bin/cp -Rp /etc/openvpn/connect.pl /etc/openvpn/connect.pl_backup
#/bin/cp -Rp /etc/openvpn/disconnect.pl /etc/openvpn/disconnect.pl_backup

cd /root/portbugfix/

#/bin/cp -Rp NVPNApi.pm /etc/openvpn/
#/bin/cp -Rp NVPNIptd.pm /etc/openvpn/
#/bin/cp -Rp connect.pl /etc/openvpn/
#/bin/cp -Rp disconnect.pl /etc/openvpn/

#cd /etc/openvpn/

#/bin/chown root:root NVPNApi.pm NVPNIptd.pm connect.pl disconnect.pl
#chmod 755 connect.pl disconnect.pl

#cd /root/portbugfix/

#/bin/cp -Rp /usr/bin/iptdaemon.pl /usr/bin/iptdaemon.pl_backup
#/bin/cp -Rp iptdaemon.pl /usr/bin/
#/bin/chown root:root /usr/bin/iptdaemon.pl
#chmod 755 /usr/bin/iptdaemon.pl

#/bin/cp -Rp /etc/raddb/nvpn_rlm.pl /etc/raddb/nvpn_rlm.pl_backup
#/bin/cp -Rp nvpn_rlm.pl /etc/raddb/
#/bin/chown root:root /etc/raddb/nvpn_rlm.pl
#chmod 755 /etc/raddb/nvpn_rlm.pl

#/bin/cp -Rp /srv/www/balalaika/dy58jdjsr8y1.pl /srv/www/balalaika/dy58jdjsr8y1.pl_backup
#/bin/cp -Rp dy58jdjsr8y1.pl /srv/www/balalaika/
#/bin/chown root:root /srv/www/balalaika/dy58jdjsr8y1.pl
#chmod 755 /srv/www/balalaika/dy58jdjsr8y1.pl

/bin/cp -Rp /etc/strongswan/updown.pl /etc/strongswan/updown.pl_backup
/bin/cp -Rp updown.pl /etc/strongswan/
/bin/chown root:root /etc/strongswan/updown.pl
chmod 755 /etc/strongswan/updown.pl

service strongswan restart ; service perl-iptdaemon restart ; service nginx restart ; service radiusd restart #; service openvpn stop ; sleep 10 ; killall openvpn ; service openvpn start 

logs

#watch -n0 'iptables -nvL FORWARD'
