This repository has been archived by the owner on Jun 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
/
linux-remove.sh
119 lines (104 loc) · 2.95 KB
/
linux-remove.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/bin/bash
#load global variables file
wget -q https://raw.githubusercontent.com/litecoin-association/LitecoinNode/master/glob-vars.sh -P /root
source /root/glob-vars.sh
rm -f -v /root/glob-vars.sh
#change working directory
cd $HOME
clear
echo ""
echo "-----------------------------------------------------------------------"
echo ""
echo "Welcome to the Litecoin node remove script."
echo "This script will remove the Litecoin full node from your computer."
echo "We will ask you some questions do determine what we need to do."
echo "To start the removal select your Linux distribution from the menu."
echo "For more information or help visit http://litecoinnode.org"
echo ""
echo "-----------------------------------------------------------------------"
echo ""
#create operating system choice menu
PS3="Please select your choice: "
CHOICE=("Ubuntu" "Debian" "Raspbian" "CentOS" "Exit")
select CHC in "${CHOICE[@]}"
do
case $CHC in
"Ubuntu")
#define distribution
DIST="ubuntu"
wget $SCRIPT_DL_URL/$DIST/$DIST-remove.sh -P $HOME
source $HOME/$DIST-remove.sh
rm -f -v $HOME/$DIST-remove.sh
rm -f -v $HOME/linux-remove.sh
#do we want to reboot the system
read -r -p "All done! Do you want to reboot? (Y/N) " ANSWER
echo
if [[ $ANSWER =~ ^([yY])$ ]]
then
shutdown -r 1 Press CTRL+C to abort.
fi
#we are done. exit the script
exit
;;
"Debian")
#define distribution
DIST="debian"
wget $SCRIPT_DL_URL/$DIST/$DIST-remove.sh -P $HOME
source $HOME/$DIST-remove.sh
rm -f -v $HOME/$DIST-remove.sh
rm -f -v $HOME/linux-remove.sh
#do we want to reboot the system
read -r -p "All done! Do you want to reboot? (Y/N) " ANSWER
echo
if [[ $ANSWER =~ ^([yY])$ ]]
then
shutdown -r 1 Press CTRL+C to abort.
fi
#we are done. exit the script
exit
;;
"Raspbian")
#define distribution
DIST="raspbian"
wget $SCRIPT_DL_URL/$DIST/$DIST-remove.sh -P $HOME
source $HOME/$DIST-remove.sh
rm -f -v $HOME/$DIST-remove.sh
rm -f -v $HOME/linux-remove.sh
#do we want to reboot the system
read -r -p "All done! Do you want to reboot? (Y/N) " ANSWER
echo
if [[ $ANSWER =~ ^([yY])$ ]]
then
shutdown -r 1 Press CTRL+C to abort.
fi
#we are done. exit the script
exit
;;
"CentOS")
#define distribution
DIST="centos"
echo "A $DIST removal script is not yet available."
#wget $SCRIPT_DL_URL/$DIST/$DIST-remove.sh -P $HOME
#source $HOME/$DIST-remove.sh
#rm -f -v $HOME/$DIST-remove.sh
#rm -f -v $HOME/linux-remove.sh
#do we want to reboot the system
#read -r -p "All done! Do you want to reboot? (Y/N) " ANSWER
#echo
#if [[ $ANSWER =~ ^([yY])$ ]]
#then
# shutdown -r 1 Press CTRL+C to abort.
#fi
#
#we are done. exit the script
#exit
;;
"Exit")
echo ""
rm -f /root/linux.sh
rm -f /$HOME/linux-remove.sh
break
;;
*) echo "Invalid option.";;
esac
done