Bug fixes
[platform/upstream/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         mypath=`echo $i | sed -e 's/\(^.*\/\)\(.*\)/\1/g' `;
14         myapp=`echo $i | sed -e 's/\(^.*\/\)\(.*\)/\2/g' `;
15         echo "  $1$mypath$myapp -> /bin/busybox"
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 exit 0