Created
September 2, 2011 16:41
-
-
Save rhiokim/1189113 to your computer and use it in GitHub Desktop.
Linux myxtreamer 2.6.12.6-VENUS BusyBox symbol link Creator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script links to busybox | |
# function: print and execute command | |
exe() | |
{ | |
echo "# ""$1" | |
echo "--------------------------------------------------------------------------------" | |
$1 | |
} | |
out=$PWD/out | |
busybox=/bin/busybox-new | |
cmds=`$busybox --help|grep "^Currently defined functions:-*$" -A30|grep \,` | |
for cmd in $cmds | |
do | |
cmd=`echo "$cmd" | sed s/,//g` | |
cmdo=`which $cmd 2>/dev/null` | |
# command exists? | |
if [ -x "$cmdo" ];then | |
# link not yet created? | |
if ! [ -x "$out$cmdo" ]; then | |
echo "[*] "`man -f $(basename $cmdo)|head -n1|cut -d "-" -f2` | |
# create the dir? | |
d=`dirname "$out$cmdo"` | |
if ! [ -d "$d" ];then | |
exe "mkdir -p "$d"" | |
fi | |
# create the link | |
exe "ln -s $busybox $out$cmdo" | |
fi | |
fi | |
done | |
exe "mkdir -p $out$(dirname $busybox)" | |
exe "cp -f $busybox $out$busybox" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment