File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# HomeServer-Script
2+
3+ > [ !NOTE]
4+ > Requires Bash version 4.2 or later.
Original file line number Diff line number Diff line change @@ -5,4 +5,7 @@ source ./lib/utils.sh
55# Pre-flight checks
66check_root
77update_system
8- install_curl
8+ install_curl
9+ install_gum
10+
11+ echo " Installation complete!"
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3+ THUMBS_UP=' \U1F44D' ;
4+
35check_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}
You can’t perform that action at this time.
0 commit comments