先参考一个:http://www.blogjava.net/chengang/archive/2007/09/12/144655.html
- #!/bin/bash
- #
- # to run the script, be root first
- #
- cd /media/usbdisk/2008Summer/
- cp Intel/amd64-2.6.18-6/e1000e.ko /lib/modules/2.6.18-6-amd64/kernel/drivers/net/
- chmod 644 /lib/modules/2.6.18-6-amd64/kernel/drivers/net/e1000e.ko
- insmod /lib/modules/2.6.18-6-amd64/kernel/drivers/net/e1000e.ko
- cp DHCP/interfaces /etc/network/interfaces
- cp DNS/resolv.conf /etc/
- #modify host name
- filename1="/etc/hostname"
- filename2="/etc/hosts"
- old=""
- read new
- sed -in-place -e "s/$old/$new/g" $filename1
- sed -in-place -e "s/$old/$new/g" $filename2
- reboot