#!/bin/sh #------------------------------------------------------------------------------ # /usr/bin/online_keyprog __FLI4LVER__ # Creation: 11.10.2014 cspiess # Last Update: $Id$ #------------------------------------------------------------------------------ case "$#" in 0) if [ -f /etc/default-route-interface ] # default route existing? then default_route_interface=`/bin/cat /etc/default-route-interface` else default_route_interface=`ip route show | grep '^default' | sed 's/^default.*dev //g'` case $default_route_interface in ppp0) default_route_interface=pppoe ;; esac fi if [ -f /var/run/online ] then # go offline log "going offline due to user button" fli4lctrl hangup $default_route_interface else # go online log "going online due to user button" fli4lctrl dial $default_route_interface fi ;; *) myname=`basename $0` echo "Usage: $myname" ;; esac