#!/bin/bash
# install/uninstall all scripts from /tools to /usr/sbin and /usr/lib
# so the user is able to use all these commands while running his/her Live Linux
#
# install script is automatically called by runme.sh
#
# Author: does it worth for such a short script ... hm... ok, Tomas M. :^)
#

ROOT="$1"
N="`basename $0`"

if [ "$N" = "install" ]; then
   mkdir -p $ROOT/usr/sbin
   mkdir -p $ROOT/usr/lib
   ls -1 ./tools | egrep -v "^lib" | while read FILE; do cp ./tools/$FILE $ROOT/usr/sbin; done
   ls -1 ./tools | egrep "^lib" | while read FILE; do cp ./tools/$FILE $ROOT/usr/lib; done
else
   ls -1 ./tools | egrep -v "^lib" | while read FILE; do rm -v $ROOT/usr/sbin/$FILE; done
   ls -1 ./tools | egrep "^lib" | while read FILE; do rm -v $ROOT/usr/lib/$FILE; done
fi

echo "Linux Live scripts were $N""ed successfuly in $1/"
