-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·146 lines (139 loc) · 4.37 KB
/
install.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#!/bin/bash
# _____ 0 | |\ /| / / / / / /
# | (___ _ __| | \ / | __ _ ____/ /_ / /_ / /_
# \___ \| |/ _` | |\/| |/ _` |_ / '_ \| '_ \| '_ \
# ____) | | (_| | | | | (_| |/ /| (_) | (_) | (_) |
# |_____/|_|\__,_|_| |_|\__,_/___|\___/ \___/ \___/ :)
install_func (){
sudo cp rw.txt /home/$USER/.config/rw.txt
sudo cp rw /bin/rw
while IFS= read line; do
printf "%s\n" "$line"
done <<-EOF
Installation Successfull!!
Type rw -h to know more..."
Install Dependencies:
lolcat
nms(no-more-secrets)
figlet
figlet-extra-fonts (3d)
EOF
exit
}
uninstall_func (){
if [[ -f "/home/$USER/.config/rw.txt" ]] && [[ -f "/bin/rw" ]]; then
sudo rm /home/$USER/.config/rw.txt
sudo rm /bin/rw
echo -e "Random Word Uninstalled From your System \n"
exit;
else
echo -e "\nRandom Word is Not Installed on your system\n"
read -p "Install/Reinstall? (y/n) " confilm
if [[ "$confilm" = "y" ]]; then
install_func
else
exit;
fi
fi
}
[[ "$1" = "--uninstall" ]] && uninstall_func
rw_install () {
read -p "Install Random Word?[y/n]: " conf
if [[ "$conf" = "y" ]]; then
install_func
else
echo "Didn't installed anything..!!" && exit
fi
}
figlet_fonts (){
git clone https://github.com/xero/figlet-fonts.git &&
cd figlet-fonts/ &&
sudo cp -R * /usr/share/figlet/ ||
sudo cp -R * /usr/share/figlet/fonts &&
[[ -f "/usr/share/figlet/3d.flf" ]] ||
[[ -f "/usr/share/figlet/fonts/3d.flf" ]] &&
echo -e "Figlet Fonts [Installed]\n" ||
echo -e "Unable to Install Figlt-Fonts\n Continuing with installing no-more-secrets....\n" &&
echo -e "Visit https://github.com/xero/figlet-fonts to know how to install figlet-fonts manually!!\n " &&
cd .. &&
rm -Rf figlet-fonts/ ||
echo -e "Unable to Delete Figlet-Fonts directory\n"
}
get_nms (){
[[ "$(man git)" ]] &&
figlet_fonts ||
git clone https://github.com/bartobri/no-more-secrets.git &&
cd ./no-more-secrets &&
make nms &&
sudo make install &&
rm -Rf no-more-secrets/ &&
echo "no-more-secrets [Installed]" && exit ||
sudo pacman -S git ||
sudo apt-get install git &&
install ||
echo -e "Something Went Wrong!!\n" &&
echo -e "Install essential build packages like base-devel, cmake, fakeroot, etc.." &&
read -p "Install build-essential/base-devel[y/n]: " $noob &&
[[ "$noob"="y" ]] &&
sudo pacman -S base-devel || sudo apt-get install build-essential intltool && install || echo "Didn't Installed No-More-Secrets!!" && exit
}
install(){
read -p "Install Lolcat, figlet & NMS? [y/n]: " $mol
[[ "$mol"="y" ]] && if [[ "$(man lolcat)" ]]; then
echo "lolcat: [Installed]"
else
sudo pacman -S lolcat || sudo apt-get install lolcat
fi
if [[ "$(man figlet)" ]];then
echo "figlet: [Installed]"
else
sudo pacman -S figlet || sudo apt-get install figlet
fi
if [[ "$(man nms)" ]];then
echo -e "no-more-secrets: [Installed]\n"
else
get_nms
fi || echo "Didn't Installed Anything" && exit
}
check () {
while true;
do
if [[ "$(man lolcat)" ]]; then
echo "lolcat: [Installed]"
fi
if [[ "$(man figlet)" ]];then
echo "figlet: [Installed]"
fi
if [[ "$(man nms)" ]];then
echo "no-more-secrets: [Installed]" && rw_install
else
install
fi
done
}
arch (){
while IFS= read line; do
printf "%s\n" "$line"
done <<-EOF
█████ ██████ ██████ ██ ██
██ ██ ██ ██ ██ ██ ██
███████ ██████ ██ ███████
██ ██ ██ ██ ██ ██ ██
██ ██ ██ ██ ██████ ██ ██
EOF
check
}
deb (){
while IFS= read line; do
printf "%s\n" "$line"
done <<-EOF
██████ ███████ ██████ ██ █████ ███ ██
██ ██ ██ ██ ██ ██ ██ ██ ████ ██
██ ██ █████ ██████ ██ ███████ ██ ██ ██
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██████ ███████ ██████ ██ ██ ██ ██ ████
EOF
check
}
[[ "$(pacman -h)" ]] && arch && exit
[[ "$(apt -h)" ]] && deb && exit