s243a

simple_network_Interface stop

Oct 6th, 2015
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.99 KB | None | 0 0
  1. #----Line #10 of http://www.pearltrees.com/s243a/simple-network-setup-usr-local/id14851906
  2. #100325 added 'stop' commandline option. added DHCPCDFIX for wired.
  3. #----Lines #42 to #59 of http://www.pearltrees.com/s243a/simple-network-setup-usr-local/id14851906
  4. if [ $1 ];then #100325
  5.  case $1 in
  6.   stop)
  7.    if [ -f /tmp/sns_interface_success ];then
  8.     INTERFACE="`cat /tmp/sns_interface_success`"
  9.     rm -f /tmp/sns_interface_success
  10.     [ "`pidof wpa_supplicant`" != "" ] && wpa_cli terminate #kill wpa_supplicant.
  11.     ifconfig $INTERFACE down
  12.     [ "`iwconfig $INTERFACE | grep "$INTERFACE" | grep "ESSID"`" != "" ] && iwconfig $INTERFACE essid off
  13.     dhcpcd --release $INTERFACE 2>/dev/null
  14.     ip route flush dev $INTERFACE #100703
  15.     #in situation bring down interface from desktop icon...
  16.     [ "$DISPLAY" ] && LANG=$LANGORIG yaf-splash -placement bottom -bg pink -timeout 5 -text "$(gettext 'Network interface') ${INTERFACE} $(gettext 'has been disabled')" &
  17.    fi
  18.    exit
  19.   ;;
  20.  esac
  21. fi
Advertisement
Add Comment
Please, Sign In to add comment