12345678910111213141516171819202122232425 |
- #!/bin/bash
- #set -o xtrace
- #logfile=/tmp/client_up
- #exec >> $logfile 2>&1
- #date
- echo ===========================================
- echo $common_name
- echo ===========================================
- ext_ovpn=`/sbin/ifconfig external | grep inet | /bin/sed 's/^ *inet addr://g' | /bin/sed 's/ .*//g'`
- echo 'Ext_Ovpn '$ext_ovpn
- paddr=`grep ifconfig-push "/etc/openvpn/ccd/$common_name" | sed 's/ifconfig-push //g' | sed 's/ .*//g'`
- echo 'Paddr '$paddr
- #if [ $? -eq 0 ]
- #then
- [[ ! -z $paddr ]] && /usr/bin/sudo /sbin/ip route add $paddr via $ext_ovpn
- #fi
- caddr=`grep iroute "/etc/openvpn/ccd/$common_name" | sed 's/iroute //g' | sed 's/ .*//g'`
- echo 'Caddr '$caddr
- #if [ $? -eq 0 ]
- #then
- [[ ! -z $caddr ]] && /usr/bin/sudo /sbin/ip route add $caddr via $ext_ovpn
- #fi
- exit 0
|