Skip to content

Commit a00f144

Browse files
committed
gum installation
1 parent bd775d8 commit a00f144

3 files changed

Lines changed: 37 additions & 2 deletions

File tree

‎README.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
# HomeServer-Script
2+
3+
>[!NOTE]
4+
>Requires Bash version 4.2 or later.

‎install.sh‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ source ./lib/utils.sh
55
# Pre-flight checks
66
check_root
77
update_system
8-
install_curl
8+
install_curl
9+
install_gum
10+
11+
echo "Installation complete!"

‎lib/utils.sh‎

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
THUMBS_UP='\U1F44D';
4+
35
check_root() {
46
if [[ "$EUID" -ne 0 ]];
57
then
@@ -19,7 +21,34 @@ install_curl() {
1921
then
2022
echo "Installing curl..."
2123
apt install curl -y > /dev/null 2>&1
24+
if [[ $? -ne 0 ]]
25+
then
26+
echo "Not able to install curl!"
27+
exit 1
28+
else
29+
printf "Curl installed successfully.${THUMBS_UP} \n"
30+
fi
31+
else
32+
printf "Curl is already installed.${THUMBS_UP} \n"
33+
fi
34+
}
35+
36+
install_gum(){
37+
if ! command -v gum &> /dev/null;
38+
then
39+
echo "Installing gum..."
40+
sudo mkdir -p /etc/apt/keyrings
41+
curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpg
42+
echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list
43+
sudo apt update && sudo apt install gum
44+
if [[ $? -ne 0 ]]
45+
then
46+
echo "Not able to install Gum!"
47+
exit 1
48+
else
49+
printf "Gum installed successfully.${THUMBS_UP} \n"
50+
fi
2251
else
23-
echo "Curl is already installed."
52+
printf "Gum already installed.${THUMBS_UP} \n"
2453
fi
2554
}

0 commit comments

Comments
 (0)