9721102a1a67c16b581f9834dfa06a24d30d60d9
[oweals/busybox.git] / applets / install.sh
1 #!/bin/sh
2
3 set -e
4
5 if [ "$1" == "" ]; then
6     echo "No installation directory, aborting."
7     exit 1;
8 fi
9
10 h=`sort busybox.links | uniq`
11
12 for i in $h ; do
13         echo "Symlinking $i to /bin/busybox"
14         mypath=`echo $i | sed -e 's/\(^.*\/\)\(.*\)/\1/g' `;
15         myapp=`echo $i | sed -e 's/\(^.*\/\)\(.*\)/\2/g' `;
16         mkdir -p $1$mypath
17         (cd $1$mypath ; rm -f $1$mypath$myapp ; ln -s /bin/busybox $1$mypath$myapp )
18 done
19 rm -f $1/bin/busybox
20 install -m 755 busybox $1/bin/busybox
21
22