Skip to content

Commit 3ca96a2

Browse files
committed
feat: streamline user prompts and improve variable handling in setup scripts
1 parent ebd1433 commit 3ca96a2

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

setup/packages/global-dev-setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ add_user_to_developers "$CURRENT_USER"
124124
if [ "$FORCE_UPDATE" = true ]; then
125125
echo ""
126126
echo "Adding all existing users to developers group..."
127-
while IFS=: read -r username _ uid _ _ home shell; do
127+
while IFS=: read -r username _ uid _ _ home _; do
128128
# Skip if UID < 1000 (system users) or if home doesn't exist
129129
if [ "$uid" -ge 1000 ] && [ -d "$home" ]; then
130130
add_user_to_developers "$username"

setup/system/fix-mysql-frozen.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ echo " 1) Remove MySQL/MariaDB and clean everything (recommended)"
2929
echo " 2) Just remove FROZEN file (risky, may cause data corruption)"
3030
echo " 3) Cancel"
3131

32-
read -r -p "Enter choice [1-3]: " choice
32+
if [[ $ACCEPT_INSTALL =~ ^[Yy]$ ]]; then
33+
choice=1
34+
else
35+
read -r -p "Enter choice [1-3]: " choice
36+
fi
3337

3438
case "$choice" in
3539
1)

setup/system/setup-zabbix-nginx.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ if [ -z "$PHP_FPM_SOCK" ]; then
7676
echo "⚠️ PHP-FPM socket not found, will use default: /run/php/php8.3-fpm.sock"
7777
echo "⚠️ Make sure PHP-FPM is installed and running"
7878
PHP_FPM_SOCK="/run/php/php8.3-fpm.sock"
79-
PHP_VERSION="8.3"
8079
fi
8180

8281
echo "📌 PHP-FPM socket: $PHP_FPM_SOCK"
@@ -208,9 +207,7 @@ if [ "$USE_SSL" = true ]; then
208207
echo "⚠️ Make sure your domain $DOMAIN_NAME points to this server IP!"
209208
read -r -p "Press Enter to continue or Ctrl+C to cancel..."
210209

211-
certbot --nginx -d "$DOMAIN_NAME" --non-interactive --agree-tos --email "$EMAIL" --redirect
212-
213-
if [ $? -eq 0 ]; then
210+
if certbot --nginx -d "$DOMAIN_NAME" --non-interactive --agree-tos --email "$EMAIL" --redirect; then
214211
echo "✓ SSL certificate obtained successfully"
215212
echo "✓ HTTPS redirect enabled"
216213
else

setup/system/zabbix.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ install_zabbix_server() {
135135
echo " 2) Remove ${DB_TYPE} and install fresh MySQL 8.0"
136136
echo " 3) Cancel installation"
137137
if [[ $ACCEPT_INSTALL =~ ^[Yy]$ ]]; then
138-
zabbix_choice="1"
138+
db_choice="1"
139139
else
140-
read -r -p "Enter choice [1-3]: " zabbix_choice
140+
read -r -p "Enter choice [1-3]: " db_choice
141141
fi
142142

143143
case "$db_choice" in

0 commit comments

Comments
 (0)