diff options
Diffstat (limited to 'Makeuninstall.rc')
| -rwxr-xr-x | Makeuninstall.rc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Makeuninstall.rc b/Makeuninstall.rc new file mode 100755 index 0000000..5ee5003 --- /dev/null +++ b/Makeuninstall.rc @@ -0,0 +1,30 @@ +#!/bin/rc + +# This script will uninstall all scripts/dirs copied into $1 +# It uses rmdir(1) to prevent removal of any files from elsewhere + +bin = $1 + +if (test -f .installed) { + installed = `$nl{cat .installed} + for (s in $installed) { + echo RM $bin/$s + rm $bin/$s + removed = ($removed $bin/$s) + } + rm .installed +} + +if (test -f .dirsmade) { + dirsmade = `$nl{cat .dirsmade} + for (d in $dirsmade) { + echo RMDIR $bin/$d + rmdir $bin/$d + removed = ($removed $bin/$s) + } + rm .dirsmade +} + +if (~ $removed ()) { + echo nothing to remove +} |