You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
294B

  1. #!/bin/bash
  2. var0=`ps aux|awk '/dhclient wlan0/'|awk '$11!="awk"{print $2}'`
  3. kill $var0
  4. cp ifcfg-wlan0 /etc/sysconfig/network-scripts/
  5. dhclient wlan0
  6. var1=`ifconfig wlan0 |awk '/inet/{print $2}'|awk -F: '{print $2}'`
  7. rm -f /etc/sysconfig/network-scripts/ifcfg-wlan0
  8. echo "get ip: $var1"