|
From: PGNd <de...@pg...> - 2014-09-14 23:50:41
|
On Sun, Sep 14, 2014, at 04:44 PM, Tom Eastep wrote:
> Do you have your own 'is_usable' extension script?
Yes. Useing it for now on the road to eventual use of lsm ... using my own to 'simply' matters. Maybe not, though.
>From my other email,
run_isusable_exit() {
local status
status=0
function local_report_status() {
local __intfc=$1
local __status=$2
if [ $__status -eq 0 ]; then
echo ' OK ping @ INTFC='${__intfc}
else
echo ' BAD ping @ INTFC='${__intfc}
fi
}
case $1 in
eth0)
THIS_PING_TGT=$PROV1_GATEWAY
ping -w1 -I ${1} ${THIS_PING_TGT} > /dev/null 2>&1
status=$?
local_report_status ${1} $status
return $status
;;
eth1)
THIS_PING_TGT=$LAN_MX1
ping -w1 -I ${1} ${THIS_PING_TGT} > /dev/null 2>&1
status=$?
local_report_status ${1} $status
return $status
;;
tun1)
THIS_PING_TGT=$PROV2_GATEWAY
ping -w1 -I ${1} ${THIS_PING_TGT} > /dev/null 2>&1
status=$?
local_report_status ${1} $status
return $status
;;
*)
return 0
;;
esac
}
where
PROV1_GATEWAY is the external interface's ISP gateway
and
PROV2_GATEWAY is the tun interface's VPN gateway, i.e., the 'other end' of the VPN pipe
|