From 0a338a9ec97f5fc8cbdff5950dfd982048ad561c Mon Sep 17 00:00:00 2001 From: q3aql Date: Sat, 2 Jul 2022 18:03:44 +0200 Subject: [PATCH] a2tm uninstaller (v0.1) --- uninstall.sh | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 uninstall.sh diff --git a/uninstall.sh b/uninstall.sh new file mode 100755 index 0000000..e980bce --- /dev/null +++ b/uninstall.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +############################################# +# a2tm - Uninstaller for a2tm Tool Manager # +# Date: 01-07-2022 # +# Author: q3aql # +# Contact: q3aql@duck.com # +############################################# +VERSION="0.1" +M_DATE="010722" +LICENSE="GPL v2.0" + +# Function to check root permissions. +function rootMessage() { + mkdir -p /etc/root &> /dev/null + administrador="$?" + if [ ${administrador} -eq 0 ] ; then + rm -rf /etc/root + else + echo "" + echo "# a2tm ${VERSION} (${M_DATE}) (${LICENSE})" + echo "" + echo "# Administrator permissions are required." + echo "" + exit + fi +} + +# Show installer for a2tm +rootMessage +echo "" +echo "# a2tm uninstaller ${VERSION} (${M_DATE}) (${LICENSE})" +echo "" +rm -rf /usr/bin/a2tm +echo "+ Removed executable (/usr/bin/a2tm)." +if [ -f /etc/systemd/system/a2tm.service ] ; then + rm -rf /etc/systemd/system/a2tm.service + echo "+ Removed service (/etc/systemd/system/a2tm.service)." + systemctl daemon-reload +fi +if [ -f /etc/init.d/a2tm ] ; then + rm -rf /etc/init.d/a2tm + echo "+ Removed service (/etc/init.d/a2tm)." +fi +echo "+ Uninstallation completed." +echo "" +