Advertisement
s243a

rc.network() - /etc/rc.d/rc.network - puppylinux

Oct 9th, 2016
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.64 KB | None | 0 0
  1. # lines 97 to 108 of /etc/rc.d/rc.network
  2. # http://www.pearltrees.com/s243a/stop-all-rc-network-puppylinux/id16440719
  3. # A function to stop everything (at shutdown, for example)
  4. # Enable accepting a param to pass to ifconfig (i.e. -a)
  5. stop_all(){
  6.     for INTERFACE in $(ifconfig $1 | grep -F 'Link encap:Ethernet' | cut -f 1 -d " ") ; do
  7.         # Skip it wake-on-lan enabled # 7mar10 stop even wake-on-lan enabled
  8.         #ethtool $INTERFACE | grep -Fq 'Wake-on: g' && continue
  9.         # clean up (kills dhcpcd, wpa_supplicant etc.)
  10.         cleanUpInterface "$INTERFACE" >/dev/null 2>&1
  11.         ip route flush dev "$INTERFACE"
  12.         ifconfig "$INTERFACE" down
  13.     done
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement