rename vars
This commit is contained in:
83
uninstall.sh
83
uninstall.sh
@@ -47,68 +47,67 @@ fi
|
|||||||
choice=$(whiptail --title "$TITLE" --checklist \
|
choice=$(whiptail --title "$TITLE" --checklist \
|
||||||
"What do you want to uninstall?
|
"What do you want to uninstall?
|
||||||
$CHECKLIST_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
|
$CHECKLIST_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
|
||||||
"curl" "(Removes curl package)" OFF \
|
"curl" "(Removes curl:// linux package)" OFF \
|
||||||
"nginxconf" "(Removes Rustdesk Nginx config)" ON \
|
"nginxconf" "(Removes Rustdesk Nginx config)" OFF \
|
||||||
"nginxall" "(Removes Nginx package + all configurations)" ON \
|
"nginxall" "(Removes *everything* releated to Nginx)" ON \
|
||||||
"wget" "(Removes wget package)" ON \
|
"wget" "(Removes wget linux package)" ON \
|
||||||
"unzip" "(Removes unzip package)" ON \
|
"unzip" "(Removes unzip linux package)" ON \
|
||||||
"tar" "(Removes tar package)" ON \
|
"tar" "(Removes tar linux package)" ON \
|
||||||
"whiptail" "(Removes whiptail package)" ON \
|
"whiptail" "(Removes whiptail linux package)" ON \
|
||||||
"dnsutils" "(Removes dnsutils package)" ON \
|
"dnsutils" "(Removes dnsutils linux package)" ON \
|
||||||
"bind-utils" "(Removes bind-utils package)" ON \
|
"bind-utils" "(Removes bind-utils linux package)" ON \
|
||||||
"bind" "(Removes bind package)" ON \
|
"bind" "(Removes bind linux package)" ON \
|
||||||
"UFW" "(Removes UFW package plus rules)" ON \
|
"UFW" "(Removes UFW linux package plus rules)" ON \
|
||||||
"Rustdesk LOGs" "(Removes RustDesk log dir)" ON \
|
"Rustdesk LOGs" "(Removes RustDesk log dir)" ON \
|
||||||
"Rustdesk Server" "(Removes Rustdesk server + services)" ON \
|
"Rustdesk Server" "(Removes Rustdesk server + services)" ON \
|
||||||
"Certbot" "(Removes Certbot package plus Let's Encrypt)" ON 3>&1 1>&2 2>&3)
|
"Certbot" "(Removes Certbot package plus Let's Encrypt)" ON 3>&1 1>&2 2>&3)
|
||||||
|
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
*"curl"*)
|
*"curl"*)
|
||||||
curl=yes
|
REMOVECURL="yes"
|
||||||
;;&
|
;;&
|
||||||
*"nginxconf"*)
|
*"nginxconf"*)
|
||||||
nginxconf=yes
|
REMOVE_NGINX_CONF="yes"
|
||||||
;;&
|
;;&
|
||||||
*"nginxall"*)
|
*"nginxall"*)
|
||||||
nginxall=yes
|
REMOVE_NGINX_ALL="yes"
|
||||||
;;&
|
;;&
|
||||||
*"wget"*)
|
*"wget"*)
|
||||||
wget=yes
|
REMOVE_WGET="yes"
|
||||||
;;&
|
;;&
|
||||||
*"unzip"*)
|
*"unzip"*)
|
||||||
unzip=yes
|
REMOVE_UNZIP="yes"
|
||||||
;;&
|
;;&
|
||||||
*"tar"*)
|
*"tar"*)
|
||||||
tar=yes
|
REMOVE_TAR="yes"
|
||||||
;;&
|
;;&
|
||||||
*"whiptail"*)
|
*"whiptail"*)
|
||||||
whiptail=yes
|
REMOVE_WHIPTAIL="yes"
|
||||||
;;&
|
;;&
|
||||||
*"dnsutils"*)
|
*"dnsutils"*)
|
||||||
dnsutils=yes
|
REMOVE_DNSUTILS="yes"
|
||||||
;;&
|
;;&
|
||||||
*"bind-utils"*)
|
*"bind-utils"*)
|
||||||
bind-utils=yes
|
REMOVE_BIND_UTILS="yes"
|
||||||
;;&
|
;;&
|
||||||
*"bind"*)
|
*"bind"*)
|
||||||
bind=yes
|
REMOVE_BIND="yes"
|
||||||
;;&
|
;;&
|
||||||
*"UFW"*)
|
*"UFW"*)
|
||||||
UFW=yes
|
REMOVE_UFW="yes"
|
||||||
;;&
|
;;&
|
||||||
*"Rustdesk LOGs"*)
|
*"Rustdesk LOGs"*)
|
||||||
Rustdesk_LOGs=yes
|
REMOVE_RUSTDESK_LOG="yes"
|
||||||
;;&
|
;;&
|
||||||
*"Rustdesk Server"*)
|
*"Rustdesk SERVER"*)
|
||||||
Rustdesk_Server=yes
|
REMOVE_RUSTDESK_SERVER="yes"
|
||||||
;;&
|
;;&
|
||||||
*"Certbot"*)
|
*"Certbot"*)
|
||||||
Certbot=yes
|
REMOVE_CERTBOT="yes"
|
||||||
;;&
|
;;&
|
||||||
*)
|
*)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
exit
|
|
||||||
|
|
||||||
msg_box "WARNING WARNING WARNING
|
msg_box "WARNING WARNING WARNING
|
||||||
|
|
||||||
@@ -138,7 +137,7 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Rustdesk Server
|
# Rustdesk Server
|
||||||
if [ -n "$Rustdesk_Server" ]
|
if [ -n "$REMOVE_RUSTDESK_SERVER" ]
|
||||||
then
|
then
|
||||||
# Rustdesk installation dir
|
# Rustdesk installation dir
|
||||||
print_text_in_color "$IGreen" "Removing RustDesk Server..."
|
print_text_in_color "$IGreen" "Removing RustDesk Server..."
|
||||||
@@ -160,80 +159,80 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Rustdesk LOG
|
# Rustdesk LOG
|
||||||
if [ -n "$Rustdesk_LOGs" ]
|
if [ -n "$REMOVE_RUSTDESK_LOG" ]
|
||||||
then
|
then
|
||||||
# Rustdesk LOG dir
|
# Rustdesk LOG dir
|
||||||
rm -rf "$RUSTDESK_LOG_DIR"
|
rm -rf "$RUSTDESK_LOG_DIR"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Certbot
|
# Certbot
|
||||||
if [ -n "$Certbot" ]
|
if [ -n "$REMOVE_CERTBOT" ]
|
||||||
then
|
then
|
||||||
if snap list | grep -q certbot > /dev/null
|
if snap list | grep -q certbot > /dev/null
|
||||||
then
|
then
|
||||||
purge_linux_package snap
|
purge_linux_package snap
|
||||||
snap remove certbot
|
snap remove certbot
|
||||||
else
|
else
|
||||||
purge_linux_packagepython3-certbot-nginx -y
|
purge_linux_package python3-certbot-nginx -y
|
||||||
fi
|
fi
|
||||||
# Also remove the actual certs
|
# Also remove the actual certs
|
||||||
rm -rf /etc/letsencrypt
|
rm -rf /etc/letsencrypt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Nginx
|
# Nginx
|
||||||
if [ -n "$nginxconf" ]
|
if [ -n "$REMOVE_NGINX_CONF" ]
|
||||||
then
|
then
|
||||||
rm -f "/etc/nginx/sites-available/rustdesk.conf"
|
rm -f "/etc/nginx/sites-available/rustdesk.conf"
|
||||||
rm -f "/etc/nginx/sites-enabled/rustdesk.conf"
|
rm -f "/etc/nginx/sites-enabled/rustdesk.conf"
|
||||||
service nginx restart
|
service nginx restart
|
||||||
elif [ -n "$nginxall" ]
|
elif [ -n "$REMOVE_NGINX_ALL" ]
|
||||||
then
|
then
|
||||||
purge_linux_package nginx
|
purge_linux_package nginx
|
||||||
rm -rf "/etc/nginx"
|
rm -rf "/etc/nginx"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# The rest
|
# The rest
|
||||||
if [ -n "$curl" ]
|
if [ -n "$REMOVE_CURL" ]
|
||||||
then
|
then
|
||||||
purge_linux_package curl
|
purge_linux_package curl
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$wget" ]
|
if [ -n "$REMOVE_WGET" ]
|
||||||
then
|
then
|
||||||
purge_linux_package wget
|
purge_linux_package wget
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$unzip" ]
|
if [ -n "$REMOVE_UNZIP" ]
|
||||||
then
|
then
|
||||||
purge_linux_package unzip
|
purge_linux_package unzip
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$tar" ]
|
if [ -n "$REMOVE_TAR" ]
|
||||||
then
|
then
|
||||||
purge_linux_package tar
|
purge_linux_package tar
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$whiptail" ]
|
if [ -n "$REMOVE_WHIPTAIL" ]
|
||||||
then
|
then
|
||||||
purge_linux_package whiptail
|
purge_linux_package whiptail
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$dnsutils" ]
|
if [ -n "$REMOVE_DNSUTILS" ]
|
||||||
then
|
then
|
||||||
purge_linux_package dnsutils
|
purge_linux_package dnsutils
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$bind-utils" ]
|
if [ -n "$REMOVE_BIND_UTILS" ]
|
||||||
then
|
then
|
||||||
purge_linux_package bind-utils
|
purge_linux_package bind-utils
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$bind" ]
|
if [ -n "$REMOVE_BIND" ]
|
||||||
then
|
then
|
||||||
purge_linux_package bind
|
purge_linux_package bind
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$UFW" ]
|
if [ -n "$REMOVE_UFW" ]
|
||||||
then
|
then
|
||||||
purge_linux_package ufw
|
purge_linux_package ufw
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user