Write a shell script to solve my Nic problem-Linux general technology-Linux programming and kernel information. The following is a detailed description. Author: fcyl
The last time I mentioned that my Ubuntu8.04 Nic has a problem.
Every time I restart the NIC driver, the driver is still restored to r8169, which means that I still need to execute several commands each time before accessing the Internet. This is very troublesome and depressing. The first reason is to write shell scripts. I found a lot of information on the Internet and finally wrote it.
Shell script:
#! /Bin/sh
PASSWORD = "XXXXXX" # XXX is your User PASSWORD
Echo $ PASSWORD | sudo-S rmmod r8169
Echo $ PASSWORD | sudo-S rmmod r8168
Cd r8168
Echo $ PASSWORD | sudo-S insmod./src/r8168.ko
Save as net
You can add it to the system startup Item in two ways:
Put net in/usr/bin.
1. Add/usr/bin/net before exit in/etc/rc. local;
2. In System Preferences?> A project with the net command added in the session can also be started upon startup;
In this way, you do not need to enter the command every time you boot the Internet. I hope there will be a better way to solve this Nic problem.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service