Skip to content

Commit 6218932

Browse files
authored
Update scripts that use read -p (#4498)
1 parent 59dfdc9 commit 6218932

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+257
-258
lines changed

.github/CONTRIBUTOR_AND_GUIDES/install/AppName-install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ msg_info "Installing Dependencies"
184184
$STD apt-get install -y ...
185185
msg_ok "Installed Dependencies"
186186

187-
read -p "Do you wish to enable HTTPS mode? (y/N): " httpschoice
187+
read -p "${TAB3}Do you wish to enable HTTPS mode? (y/N): " httpschoice
188188
```
189189

190190
### 6.2 **Verbosity**

ct/homarr.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ EOF
151151
systemctl start homarr
152152
msg_ok "Started Services"
153153
msg_ok "Updated Successfully"
154-
read -p "It's recommended to reboot the LXC after an update, would you like to reboot the LXC now ? (y/n): " choice
154+
read -p "${TAB3}It's recommended to reboot the LXC after an update, would you like to reboot the LXC now ? (y/n): " choice
155155
if [[ "$choice" =~ ^[Yy]$ ]]; then
156156
reboot
157157
fi

ct/homeassistant-core.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ function update_script() {
114114

115115
if [ "$UPD" == "3" ]; then
116116
set +Eeuo pipefail
117-
read -r -p "Would you like to use No Authentication? <y/N> " prompt
117+
read -r -p "${TAB3}Would you like to use No Authentication? <y/N> " prompt
118118
msg_info "Installing FileBrowser"
119119
RELEASE=$(curl -fsSL https://api.github.com/repos/filebrowser/filebrowser/releases/latest | grep -o '"tag_name": ".*"' | sed 's/"//g' | sed 's/tag_name: //g')
120120
$STD curl -fsSL https://github.com/filebrowser/filebrowser/releases/download/$RELEASE/linux-amd64-filebrowser.tar.gz | tar -xzv -C /usr/local/bin

install/alpine-docker-install.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ $STD rc-update add docker default
2929
msg_ok "Installed Docker"
3030

3131
get_latest_release() {
32-
curl -fsSL https://api.github.com/repos/$1/releases/latest | grep '"tag_name":' | cut -d'"' -f4
32+
curl -fsSL https://api.github.com/repos/"$1"/releases/latest | grep '"tag_name":' | cut -d'"' -f4
3333
}
3434
PORTAINER_LATEST_VERSION=$(get_latest_release "portainer/portainer")
3535
DOCKER_COMPOSE_LATEST_VERSION=$(get_latest_release "docker/compose")
3636
PORTAINER_AGENT_LATEST_VERSION=$(get_latest_release "portainer/agent")
3737

38-
read -r -p "Would you like to add Portainer? <y/N> " prompt
38+
read -r -p "${TAB3}Would you like to add Portainer? <y/N> " prompt
3939
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
4040
msg_info "Installing Portainer $PORTAINER_LATEST_VERSION"
4141
docker volume create portainer_data >/dev/null
@@ -49,7 +49,7 @@ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
4949
portainer/portainer-ce:latest
5050
msg_ok "Installed Portainer $PORTAINER_LATEST_VERSION"
5151
else
52-
read -r -p "Would you like to add the Portainer Agent? <y/N> " prompt
52+
read -r -p "${TAB3}Would you like to add the Portainer Agent? <y/N> " prompt
5353
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
5454
msg_info "Installing Portainer agent $PORTAINER_AGENT_LATEST_VERSION"
5555
$STD docker run -d \
@@ -62,13 +62,13 @@ else
6262
msg_ok "Installed Portainer Agent $PORTAINER_AGENT_LATEST_VERSION"
6363
fi
6464
fi
65-
read -r -p "Would you like to add Docker Compose? <y/N> " prompt
65+
read -r -p "${TAB3}Would you like to add Docker Compose? <y/N> " prompt
6666
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
6767
msg_info "Installing Docker Compose $DOCKER_COMPOSE_LATEST_VERSION"
6868
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
69-
mkdir -p $DOCKER_CONFIG/cli-plugins
70-
curl -fsSL https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_LATEST_VERSION/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
71-
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
69+
mkdir -p "$DOCKER_CONFIG"/cli-plugins
70+
curl -fsSL https://github.com/docker/compose/releases/download/"$DOCKER_COMPOSE_LATEST_VERSION"/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
71+
chmod +x "$DOCKER_CONFIG"/cli-plugins/docker-compose
7272
msg_ok "Installed Docker Compose $DOCKER_COMPOSE_LATEST_VERSION"
7373
fi
7474

install/alpine-komodo-install.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ $STD rc-update add docker boot
2626
$STD service docker start
2727
msg_ok "Enabled Docker Service"
2828

29-
echo "Choose the database for Komodo installation:"
30-
echo "1) MongoDB (recommended)"
31-
echo "2) SQLite"
32-
echo "3) PostgreSQL"
33-
read -rp "Enter your choice (default: 1): " DB_CHOICE
29+
echo "${TAB3}Choose the database for Komodo installation:"
30+
echo "${TAB3}1) MongoDB (recommended)"
31+
echo "${TAB3}2) SQLite"
32+
echo "${TAB3}3) PostgreSQL"
33+
read -rp "${TAB3}Enter your choice (default: 1): " DB_CHOICE
3434
DB_CHOICE=${DB_CHOICE:-1}
3535

3636
case $DB_CHOICE in

install/alpine-mariadb-install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql >/dev/null
2929
$STD rc-service mariadb start
3030
msg_ok "MariaDB Configured"
3131

32-
read -r -p "Would you like to install Adminer with lighttpd? <y/N>: " prompt
32+
read -r -p "${TAB3}Would you like to install Adminer with lighttpd? <y/N>: " prompt
3333
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
3434
msg_info "Installing Adminer and dependencies"
3535
$STD apk add --no-cache \

install/alpine-postgresql-install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ sed -i '/^host\s\+all\s\+all\s\+127.0.0.1\/32\s\+md5/ s/.*/host all all 0.0.0.0\
3333
$STD rc-service postgresql restart
3434
msg_ok "Configured and Restarted PostgreSQL"
3535

36-
read -r -p "Would you like to install Adminer with lighttpd? <y/N>: " prompt
36+
read -r -p "${TAB3}Would you like to install Adminer with lighttpd? <y/N>: " prompt
3737
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
3838
msg_info "Installing Adminer and dependencies"
3939
$STD apk add --no-cache \

install/alpine-traefik-install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ msg_info "Installing Traefik"
2121
$STD apk add traefik --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
2222
msg_ok "Installed Traefik"
2323

24-
read -p "Enable Traefik WebUI (Port 8080)? [y/N]: " enable_webui
24+
read -p "${TAB3}Enable Traefik WebUI (Port 8080)? [y/N]: " enable_webui
2525
if [[ "$enable_webui" =~ ^[Yy]$ ]]; then
2626
msg_info "Configuring Traefik WebUI"
2727
mkdir -p /etc/traefik/config

install/alpine-wireguard-install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ $STD rc-update add sysctl
4646
$STD sysctl -p /etc/sysctl.conf
4747
msg_ok "Installed WireGuard"
4848

49-
read -rp "Do you want to install WGDashboard? (y/N): " INSTALL_WGD
49+
read -rp "${TAB3}Do you want to install WGDashboard? (y/N): " INSTALL_WGD
5050
if [[ "$INSTALL_WGD" =~ ^[Yy]$ ]]; then
5151
msg_info "Installing additional dependencies for WGDashboard"
5252
$STD apk add --no-cache \

install/apache-tomcat-install.sh

Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ update_os
1515

1616
msg_info "Installing Dependencies"
1717
$STD apt-get install -y \
18-
gnupg2 \
19-
lsb-release \
20-
gpg \
21-
apt-transport-https
18+
gnupg2 \
19+
lsb-release \
20+
gpg \
21+
apt-transport-https
2222
msg_ok "Installed Dependencies"
2323

2424
msg_info "Setting up Adoptium Repository"
@@ -28,90 +28,90 @@ echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_COD
2828
$STD apt-get update
2929
msg_ok "Set up Adoptium Repository"
3030

31-
read -r -p "Which Tomcat version would you like to install? (9, 10.1, 11): " version
31+
read -r -p "${TAB3}Which Tomcat version would you like to install? (9, 10.1, 11): " version
3232
case $version in
3333
9)
34-
TOMCAT_VERSION="9"
35-
echo "Which LTS Java version would you like to use? (8, 11, 17, 21): "
36-
read -r jdk_version
37-
case $jdk_version in
38-
8)
39-
msg_info "Installing Temurin JDK 8 (LTS) for Tomcat $TOMCAT_VERSION"
40-
$STD apt-get install -y temurin-8-jdk
41-
msg_ok "Setup Temurin JDK 8 (LTS)"
42-
;;
43-
11)
44-
msg_info "Installing Temurin JDK 11 (LTS) for Tomcat $TOMCAT_VERSION"
45-
$STD apt-get install -y temurin-11-jdk
46-
msg_ok "Setup Temurin JDK 11 (LTS)"
47-
;;
48-
17)
49-
msg_info "Installing Temurin JDK 17 (LTS) for Tomcat $TOMCAT_VERSION"
50-
$STD apt-get install -qqy temurin-17-jdk
51-
msg_ok "Setup Temurin JDK 17 (LTS)"
52-
;;
53-
21)
54-
msg_info "Installing Temurin JDK 21 (LTS) for Tomcat $TOMCAT_VERSION"
55-
$STD apt-get install -y temurin-21-jdk
56-
msg_ok "Setup Temurin JDK 21 (LTS)"
57-
;;
58-
*)
59-
msg_error "Invalid JDK version selected. Please enter 8, 11, 17 or 21."
60-
exit 1
61-
;;
62-
esac
34+
TOMCAT_VERSION="9"
35+
echo "Which LTS Java version would you like to use? (8, 11, 17, 21): "
36+
read -r jdk_version
37+
case $jdk_version in
38+
8)
39+
msg_info "Installing Temurin JDK 8 (LTS) for Tomcat $TOMCAT_VERSION"
40+
$STD apt-get install -y temurin-8-jdk
41+
msg_ok "Setup Temurin JDK 8 (LTS)"
6342
;;
43+
11)
44+
msg_info "Installing Temurin JDK 11 (LTS) for Tomcat $TOMCAT_VERSION"
45+
$STD apt-get install -y temurin-11-jdk
46+
msg_ok "Setup Temurin JDK 11 (LTS)"
47+
;;
48+
17)
49+
msg_info "Installing Temurin JDK 17 (LTS) for Tomcat $TOMCAT_VERSION"
50+
$STD apt-get install -qqy temurin-17-jdk
51+
msg_ok "Setup Temurin JDK 17 (LTS)"
52+
;;
53+
21)
54+
msg_info "Installing Temurin JDK 21 (LTS) for Tomcat $TOMCAT_VERSION"
55+
$STD apt-get install -y temurin-21-jdk
56+
msg_ok "Setup Temurin JDK 21 (LTS)"
57+
;;
58+
*)
59+
msg_error "Invalid JDK version selected. Please enter 8, 11, 17 or 21."
60+
exit 1
61+
;;
62+
esac
63+
;;
6464
10 | 10.1)
65-
TOMCAT_VERSION="10"
66-
echo "Which LTS Java version would you like to use? (11, 17): "
67-
read -r jdk_version
68-
case $jdk_version in
69-
11)
70-
msg_info "Installing Temurin JDK 11 (LTS) for Tomcat $TOMCAT_VERSION"
71-
$STD apt-get install -y temurin-11-jdk
72-
msg_ok "Setup Temurin JDK 11"
73-
;;
74-
17)
75-
msg_info "Installing Temurin JDK 17 (LTS) for Tomcat $TOMCAT_VERSION"
76-
$STD apt-get install -y temurin-17-jdk
77-
msg_ok "Setup Temurin JDK 17"
78-
;;
79-
21)
80-
msg_info "Installing Temurin JDK 21 (LTS) for Tomcat $TOMCAT_VERSION"
81-
$STD apt-get install -y temurin-21-jdk
82-
msg_ok "Setup Temurin JDK 21 (LTS)"
83-
;;
84-
*)
85-
msg_error "Invalid JDK version selected. Please enter 11 or 17."
86-
exit 1
87-
;;
88-
esac
65+
TOMCAT_VERSION="10"
66+
echo "Which LTS Java version would you like to use? (11, 17): "
67+
read -r jdk_version
68+
case $jdk_version in
69+
11)
70+
msg_info "Installing Temurin JDK 11 (LTS) for Tomcat $TOMCAT_VERSION"
71+
$STD apt-get install -y temurin-11-jdk
72+
msg_ok "Setup Temurin JDK 11"
73+
;;
74+
17)
75+
msg_info "Installing Temurin JDK 17 (LTS) for Tomcat $TOMCAT_VERSION"
76+
$STD apt-get install -y temurin-17-jdk
77+
msg_ok "Setup Temurin JDK 17"
8978
;;
79+
21)
80+
msg_info "Installing Temurin JDK 21 (LTS) for Tomcat $TOMCAT_VERSION"
81+
$STD apt-get install -y temurin-21-jdk
82+
msg_ok "Setup Temurin JDK 21 (LTS)"
83+
;;
84+
*)
85+
msg_error "Invalid JDK version selected. Please enter 11 or 17."
86+
exit 1
87+
;;
88+
esac
89+
;;
9090
11)
91-
TOMCAT_VERSION="11"
92-
echo "Which LTS Java version would you like to use? (17, 21): "
93-
read -r jdk_version
94-
case $jdk_version in
95-
17)
96-
msg_info "Installing Temurin JDK 17 (LTS) for Tomcat $TOMCAT_VERSION"
97-
$STD apt-get install -qqy temurin-17-jdk
98-
msg_ok "Setup Temurin JDK 17"
99-
;;
100-
21)
101-
msg_info "Installing Temurin JDK 21 (LTS) for Tomcat $TOMCAT_VERSION"
102-
$STD apt-get install -y temurin-21-jdk
103-
msg_ok "Setup Temurin JDK 21 (LTS)"
104-
;;
105-
*)
106-
msg_error "Invalid JDK version selected. Please enter 17 or 21."
107-
exit 1
108-
;;
109-
esac
91+
TOMCAT_VERSION="11"
92+
echo "Which LTS Java version would you like to use? (17, 21): "
93+
read -r jdk_version
94+
case $jdk_version in
95+
17)
96+
msg_info "Installing Temurin JDK 17 (LTS) for Tomcat $TOMCAT_VERSION"
97+
$STD apt-get install -qqy temurin-17-jdk
98+
msg_ok "Setup Temurin JDK 17"
11099
;;
111-
*)
112-
msg_error "Invalid Tomcat version selected. Please enter 9, 10.1 or 11."
100+
21)
101+
msg_info "Installing Temurin JDK 21 (LTS) for Tomcat $TOMCAT_VERSION"
102+
$STD apt-get install -y temurin-21-jdk
103+
msg_ok "Setup Temurin JDK 21 (LTS)"
104+
;;
105+
*)
106+
msg_error "Invalid JDK version selected. Please enter 17 or 21."
113107
exit 1
114108
;;
109+
esac
110+
;;
111+
*)
112+
msg_error "Invalid Tomcat version selected. Please enter 9, 10.1 or 11."
113+
exit 1
114+
;;
115115
esac
116116

117117
msg_info "Installing Tomcat $TOMCAT_VERSION"

0 commit comments

Comments
 (0)