#!/bin/bash # Script to edadicate a pkg source `which ttPM-funcs` 2>/dev/null || exit 1 usage() { printMsg warning "Usage: `basename $0` pkgName" exit 1 } # Should be run as root checkRoot # Validity checks for arguments and vars if [ $# -ne 1 ] then usage 1 fi PKG="$1" printMsg warning "All files that belong to user $PKG will be deleted!!!" printMsg warning "The user and group $PKG will also be deleted!!!" printMsg waning "Press Ctrl-C before countdown if you would like to abort..." for i in 10 9 8 7 6 5 4 3 2 1 0 do echo -n "$i " sleep 1 done echo for f in $(find $TT_PKG_DIRS $TT_HOME_DIR $TT_VAR_DIR -user $PKG | sort) do rm -vrf $f done userdel $PKG groupdel $PKG