-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathuncivilized.sh
55 lines (49 loc) · 1.32 KB
/
uncivilized.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
#title: uncivilized.sh
#description: Removal Script
#author: R12W4N
#==============================================================================
[ "$DEBUG" == 'true' ] && set -x
RED=`tput setaf 1`
GREEN=`tput setaf 2`
RESET=`tput sgr0`
BLUE=`tput setaf 4`
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
function trap_ctrlc ()
{
echo "Ctrl-C caught...performing clean up"
echo "Doing cleanup"
trap "kill 0" EXIT
exit 2
}
trap "trap_ctrlc" 2
function test(){
falconmodules=modules/
if [[ ! -d "$falconmodules" ]]; then
echo "${RED} $falconmodules Directory Not Exist ${RESET}"
wget -P ./modules/ https://raw.githubusercontent.com/BlackFalconBot/FalconPi/master/modules/adduser.sh
elif [ -d "$falconmodules" ]
then
echo "All Good"
fi
}
function unsetup()
{
echo "${GREEN}Users On this system${RESET}"
echo | ls /home
read -p "${RED}Enter FalconPool Unit Name : ${RESET}" FalconName
echo "${GREEN}Deleting User $FalconName ${RESET}"
/bin/bash ./modules/adduser.sh -a del $FalconName
echo "${GREEN}Removing SSH Keys ${RESET}"
rm ~/.ssh/*
echo "${GREEN}Removing rc-local.service${RESET}"
sudo systemctl disable rc-local
rm /etc/systemd/system/rc-local.service
rm /etc/rc.local
echo "${GREEN}Reboot this device...${RESET}"
}
test
unsetup