fc80565cb5751af18ced506a62495e8642ee713a
[sfrench/samba-autobuild/.git] / source3 / script / uninstallmodules.sh
1 #!/bin/sh
2 #4 July 96 Dan.Shearer@UniSA.edu.au   
3
4 INSTALLPERMS=$1
5 DESTDIR=$2
6 prefix=`echo $3 | sed 's/\/\//\//g'`
7 LIBDIR=`echo $4 | sed 's/\/\//\//g'`
8 shift
9 shift
10 shift
11 shift
12
13 if [ ! -d $DESTDIR/$LIBDIR ]; then
14   echo "Directory $DESTDIR/$LIBDIR does not exist! "
15   echo "Do a "make installmodules" or "make install" first. "
16   exit 1
17 fi
18
19 for p in $*; do
20   p2=`basename $p`
21   if [ -f $DESTDIR/$LIBDIR/$p2 ]; then
22     echo "Removing $DESTDIR/$LIBDIR/$p2 "
23     rm -f $DESTDIR/$LIBDIR/$p2
24     if [ -f $DESTDIR/$LIBDIR/$p2 ]; then
25       echo "Cannot remove $DESTDIR/$LIBDIR/$p2 ... does $USER have privileges? "
26     fi
27   fi
28 done
29
30
31 cat << EOF
32 ======================================================================
33 The modules have been uninstalled. You may restore the modules using
34 the command "make installmodules" or "make install" to install 
35 binaries, modules, man pages and shell scripts. 
36 ======================================================================
37 EOF
38
39 exit 0