DISTBIN="/bin/busybox.distrib"
VERBOSE="0"
+SYMLINK="1"
INSTBINARY_SHA1=`$EXECPWR sha1sum $EXECPWR | $EXECPWR awk '{ print $1 }'`
ORIGBINARY_SHA1=`$EXECPWR sha1sum /bin/busybox | $EXECPWR awk '{ print $1 }'`
# Check whether symlinks have been made before
CHECK_SYMLINKSFILE() {
if test -e $INSTALLDIR/busybox-power.symlinks; then
- echo "error: symlinks already seem to be made?"
- echo " this script is not supposed to be ran twice"
- exit 1
+ ECHO_VERBOSE "symlinks are already made, skipping creation"
+ SYMLINK="0"
fi
}
ECHO_VERBOSE " version string: `$EXECPWR | $EXECPWR head -n 1`"
CHECK_ENV && ECHO_VERBOSE " environment: $ENVIRONMENT"
-CHECK_STANDALONE
CHECK_APPLETSFILE
CHECK_SYMLINKSFILE
if test "$ENVIRONMENT" != "SDK"; then
- CHECK_ROOT; fi
+ CHECK_ROOT
+fi
BACKUP
INSTALL
-SYMLINK
+if test $SYMLINK == 1; then
+ SYMLINK
+fi
ECHO_VERBOSE " version string: `$EXECPWR | $EXECPWR head -n 1`"
CHECK_ENV && ECHO_VERBOSE " environment: $ENVIRONMENT"
-CHECK_STANDALONE
CHECK_SYMLINKSFILE
if test "$ENVIRONMENT" != "SDK"; then
CHECK_ROOT
- CHECK_BACKUP
- CHECK_INSTALLEDBIN
fi
+CHECK_BACKUP
+CHECK_INSTALLEDBIN
if test -e /tmp/busybox-power-error; then
# An error has occured during the checks
DISPLAY_ERRORS
fi
}
-# Check whether I'm running standalone
-CHECK_STANDALONE() {
- #if test -n "`pgrep dpkg`" -o "`pgrep apt`"
- if ! lsof /var/lib/dpkg/lock >> /dev/null; then
- echo "error: you're running me as a stand-alone application"
- echo " do not do this, I will be called automatically when"
- echo " required by busybox-power"
- exit 1
- fi
-}
-
# Check whether the user is root
CHECK_ROOT() {
if test "`$EXECPWR id -u`" -ne 0; then
- echo "error: you're not running me as root, aborting"
- echo " also, DO NOT run me as a stand-alone application"
- echo " I will be called automatically when required by"
- echo " busybox-power"
+ echo "error: you're not running me as root"
exit 1
fi
}