Skip to content

Commit ac7a6df

Browse files
author
Soulsender
committed
did a lot of unfucking
optimized the script added more distro support fixed some general bugs
1 parent 6e85207 commit ac7a6df

2 files changed

Lines changed: 74 additions & 47 deletions

File tree

install.sh

Lines changed: 73 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -73,36 +73,68 @@ function alias_workflow {
7373

7474
# clean up
7575
echo -e "${green}[+] Installation Successful"
76-
echo -e "[+] Please Restart your terminal"
77-
echo -e "[+] type 'key' launch SkeletonKey${reset}"
78-
bash
76+
echo -e "[+] You might have to restart your terminal"
77+
echo -e "[+] Type 'key' in a new terminal to launch SkeletonKey${reset}"
78+
}
79+
80+
function debian_install {
81+
sudo apt update
82+
sudo apt-get install -y python3 python3-pip python-dev
83+
}
84+
85+
function void_install {
86+
sudo xbps-install -Sy python3 python3-pip python3-devel
87+
}
88+
89+
function arch_install {
90+
sudo pacman -Sy python python-pip python-setuptools
91+
}
92+
93+
function python_install {
94+
pip install qrcode
95+
pip install Cryptography
96+
pip install googletrans==3.1.0a0
97+
pip install colorama
98+
pip install pillow
99+
pip install pyenchant
100+
pip install numpy
79101
}
80102

81103
# check if run with sudo
82-
if [ "$EUID" -ne 0 ]; then
83-
continue
84-
else
85-
echo -e "${red}Do not run as root. The script will prompt you for root access.${reset}"
86-
exit 0
104+
if [ "$EUID" -eq 0 ]; then
105+
echo -e "${red}[!] Do not run as root. ${reset}The installation script will prompt you for root access."
106+
exit 1
87107
fi
88108

109+
89110
# arguments
90111
while [ -n "$1" ]
91112
do
92113
case "$1" in
93114
--help)
94-
echo "
115+
echo -e "
95116
SUPPORTED DISTROS:
96-
- Debian
117+
${red}- Debian
97118
- Parrot
98119
- Ubuntu
99120
- Kali
100121
- Mint
101-
- Arch
102-
- Void
103-
104-
Please see the SkeletonKey README for more infomation:
105-
https://github.com/CosmodiumCS/SkeletonKey
122+
- Elementary OS
123+
- Zorin
124+
- MX
125+
- Pop
126+
- Deepin ${reset}
127+
${blue}- Arch
128+
- Manjaro
129+
- Garuda
130+
- Artix
131+
- EndeavourOS
132+
- ArcoLinux
133+
- RebornOS ${reset}
134+
${green}- Void ${reset}
135+
136+
Please see the SkeletonKey README for more infomation about unsupported distros:
137+
${blue}https://github.com/CosmodiumCS/SkeletonKey${reset}
106138
"
107139
exit 0
108140
;;
@@ -115,51 +147,46 @@ esac
115147
shift
116148
done
117149

118-
# check for valid distro (Parrot, Ubuntu, Void, Debian, Arch)
119-
distro=`sudo cat /etc/issue | awk '{print $1;}'`
150+
# get distro
151+
distro=$(lsb_release -i | cut -f 2-)
152+
153+
# list of valid distros
154+
debian_systems=("Ubuntu" "Debian" "Linuxmint" "Kali" "Parrot" "elementary OS" "MX" "Zorin" "Pop" "Deepin")
155+
arch_systems=("Arch Linux" "Manjaro Linux" "Garuda" "Artix")
120156

121-
if [[ "$distro" == "Debian" ]] || [[ "$distro" == "Parrot" ]] || [[ "$distro" == "Ubuntu" ]] || [[ "$distro" == "Linux" ]] || [[ "$distro" == "Kali" ]]; then
157+
if [[ " ${debian_systems[*]} " == *"$distro"* ]]; then
122158
# installing tools for debian
123-
echo -e "${red}Debian${reset} system detected."
159+
echo -e "${red}$distro${reset} system detected."
124160
echo -e "${blue}[*] Installing tools...${reset}"
125-
sudo apt update
126-
sudo apt-get install -y python3 python3-pip python-dev
127-
pip install qrcode
128-
pip install Cryptography
129-
pip install googletrans==3.1.0a0
130-
pip install colorama
131-
pip install pillow
132-
pip install pyenchant
133-
pip install numpy
161+
debian_install
162+
python_install
134163
echo -e "${green}[+] Completed${reset}"
135164

136-
elif [[ "$distro" == "Void" ]]; then
137-
# installing tools for void
138-
echo -e "${green}Void${reset} system detected."
165+
elif [[ " ${arch_systems[*]} " == *"$distro"* ]]; then
166+
# installing tools for arch
167+
echo -e "${blue}Arch${reset} system detected."
139168
echo -e "${blue}[*] Installing tools...${reset}"
140-
sudo xbps-install -S python3
141-
pip install qrcode
142-
pip install Cryptography
143-
pip install googletrans==3.1.0a0
144-
pip install colorama
169+
arch_install
170+
python_install
145171
echo -e "${green}[+] Completed${reset}"
146172

147-
elif [[ "$distro" = "Arch" ]]; then
148-
# installing tools for arch
149-
echo -e "${blue}Arch${reset} system detected."
173+
elif [[ "$distro" == "Void" ]]; then
174+
# installing tools for void
175+
echo -e "${green}$distro${reset} system detected."
150176
echo -e "${blue}[*] Installing tools...${reset}"
151-
sudo pacman -Syu
152-
sudo pacman -S python python-pip
153-
python3 -m pip install qrcode
154-
python3 -m pip install Cryptography
155-
python3 -m pip install googletrans==3.1.0a0
156-
python3 -m pip install colorama
177+
void_install
178+
python_install
157179
echo -e "${green}[+] Completed${reset}"
158180

159181
else
160-
echo -e "${red}[!] Unknown distro, please see documentation for unknown distros.${reset}"
182+
echo -e "${red}[!] Unknown distro: \"$distro\", please see documentation for unknown distros.${reset}"
161183
exit 0
162184
fi
163185

186+
# install lsb_release command because arch and void are quirky and don't want to have it by default even though it's literally like 1mb
187+
sudo pacman -Sy --noconfirm lsb-release > /dev/null
188+
sudo xbps-install -y lsb-release > /dev/null
189+
sudo apt install -y lsb-release > /dev/null
190+
164191
# call alias workflow
165192
alias_workflow

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2
1+
1.2.1

0 commit comments

Comments
 (0)