Tag: Add network function and shutdown restart function for streamlined system
The
3rd chapter adds network function and switching power to the streamlined Linux system.
Before reading this blog post, it is recommended to read my last two blog posts, and preferably in order to read: (Otherwise I may think that I write unintelligible, hehe!) )
1th article: The Linux system is cut to make an extremely streamlined linux-1http://blog.51cto.com/linuxprince/2045703
2nd article: the Linux system cuts, making an extremely streamlined linux-2-script to automate the copying of commands and dependent library files http://blog.51cto.com/linuxprince/2046142
3.1 Increased network functionality for streamlined Minilinux systems
First perfect the frozen copy command and rely on the library file script, perfect after the complete program as follows:
[email protected] ~]# cat bincp.sh
#!/bin/bash
#
Despath=/mnt/sysroot
LIBCP () {
libpath=${1%/*}
[!-D $LIBPATH] && mkdir-p $LIBPATH
[!-e $DESPATH $] && CP $ $DESPATH $libpath
}
BINCP () {
binpath=${1%/*}
[!-D $BINPATH] && mkdir-p $DESPATH $binpath
[!-e $DESPATH $] && CP $ $DESPATH $binpath
Deplibs= ' LDD $ | Grep-o "/lib\ (64\) \{0,1\}/[^[:space:]]\{1,\}" '
For LIB in $DEPLIBS;
Do libcp $LIB;
Done
}
Read-p "Input command what is want to copy to Minilinux:" CMD
until [$CMD = = ' Q '];d o
! Which $CMD &>/dev/null && echo "Your input Command is not found." && read-p "input agent:" CMD &A mp;& continue
Command= ' which $CMD | Grep-v "^alias" | Sed ' s/\t//g '
BINCP $COMMAND
echo "Copy $COMMAND finishd."
Read-p "Continue input command to Minilinux:" CMD
Done
Linux system cut, make an extremely thin linux-3-for streamlined system to increase network function and shutdown restart function