Skip to content

Commit

Permalink
Merge dev into master for v1.8.0b
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroSteiner committed May 22, 2017
2 parents 7a0f459 + 1f481db commit bcd2c59
Showing 1 changed file with 30 additions and 5 deletions.
35 changes: 30 additions & 5 deletions tools/uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# Project Home Page: https://github.com/securestate/king-phisher/
# Authors:
# Erik Daguerre
# Hunter DeMeyer
#
###############################################################################

Expand Down Expand Up @@ -57,11 +58,12 @@ function show_help {
echo "King Phisher uninstall Script"
echo ""
echo "optional arguments"
echo " -h, --help show this help message and exit"
echo " -n, --no answer no to all questions"
echo " -y, --yes answer yes to all questions"
echo " --delete-database delete the King Phisher database"
echo " --delete-directory delete the King Phisher directory"
echo " -h, --help show this help message and exit"
echo " -n, --no answer no to all questions"
echo " -y, --yes answer yes to all questions"
echo " --delete-database delete the King Phisher database"
echo " --delete-directory delete the King Phisher directory"
echo " --delete-config [USER] delete the King Phisher configuration, optionally for USER"
return 0;
}

Expand Down Expand Up @@ -91,6 +93,20 @@ while :; do
--delete-directory)
KING_PHISHER_DELETE_DIRECTORY="x"
;;
--delete-config)
KING_PHISHER_DELETE_CONFIG="x"
user="$(logname)"
if [ ! -z $2 ]; then
if [ ! "$(echo $2 | cut -c1)" == "-" ]; then
if [ ! "$(id -u $2)" == "" ]; then
user="$2"
else
exit $E_USAGE
fi
fi
fi
;;

--)
shift
break
Expand Down Expand Up @@ -140,6 +156,15 @@ if [ ! -z $KING_PHISHER_DELETE_DIRECTORY ]; then
fi
fi

if [ ! -z $KING_PHISHER_DELETE_CONFIG ]; then
echo "Warning: The configuration for $user will be removed"
prompt_yes_or_no "Are you sure you want to continue?" "no" KING_PHISHER_DELETE_CONFIRM
if [ "$KING_PHISHER_DELETE_CONFIRM" == "yes" ]; then
rm -rf "/home/$user/.config/king-phisher"
echo "The King Phisher configuration for $user has been removed"
fi
fi

if [ -f /lib/systemd/system/king-phisher.service ]; then
if ! systemctl is-active king-phisher; then
systemctl stop king-phisher
Expand Down

0 comments on commit bcd2c59

Please sign in to comment.