Search This Blog

Wednesday, May 21, 2008

[Nautilius Script] 重新取得網路卡ip address

1.將"root password"填入root的密碼
2.將 eth1換為要取得ip address之網路裝置代碼

==========================================
#!/bin/bash

echo "root password" | sudo -S dhclient eth1

zenity --info --title "Wireless IP Address" --text $(/sbin/ifconfig eth1 | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2)
==========================================

No comments: