Skip to content

Commit 3657886

Browse files
committed
chore: remove color codes
1 parent 40e89cd commit 3657886

File tree

1 file changed

+22
-28
lines changed
  • plugin/source/dynamix.unraid.net/usr/local/share/dynamix.unraid.net/install/scripts

1 file changed

+22
-28
lines changed

plugin/source/dynamix.unraid.net/usr/local/share/dynamix.unraid.net/install/scripts/verify_install.sh

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@
55
# Exit on errors
66
set -e
77

8-
# Define color codes for output
9-
GREEN='\033[0;32m'
10-
RED='\033[0;31m'
11-
YELLOW='\033[0;33m'
12-
NC='\033[0m' # No Color
13-
148
echo "Performing comprehensive installation verification..."
159

1610
# Define critical files to check (POSIX-compliant, no arrays)
@@ -40,35 +34,35 @@ TOTAL_ERRORS=0
4034
# Function to check if file exists and is executable
4135
check_executable() {
4236
if [ -x "$1" ]; then
43-
printf '%s✓%s Executable file %s exists and is executable\n' "$GREEN" "$NC" "$1"
37+
printf ' Executable file %s exists and is executable\n' "$1"
4438
return 0
4539
elif [ -f "$1" ]; then
46-
printf '%s⚠%s File %s exists but is not executable\n' "$YELLOW" "$NC" "$1"
40+
printf ' File %s exists but is not executable\n' "$1"
4741
return 1
4842
else
49-
printf '%s✗%s Executable file %s is missing\n' "$RED" "$NC" "$1"
43+
printf ' Executable file %s is missing\n' "$1"
5044
return 2
5145
fi
5246
}
5347

5448
# Function to check if directory exists
5549
check_dir() {
5650
if [ -d "$1" ]; then
57-
printf '%s✓%s Directory %s exists\n' "$GREEN" "$NC" "$1"
51+
printf ' Directory %s exists\n' "$1"
5852
return 0
5953
else
60-
printf '%s✗%s Directory %s is missing\n' "$RED" "$NC" "$1"
54+
printf ' Directory %s is missing\n' "$1"
6155
return 1
6256
fi
6357
}
6458

6559
# Function to check symlinks
6660
check_symlink() {
6761
if [ -L "$1" ]; then
68-
printf '%s✓%s Symlink %s exists -> %s\n' "$GREEN" "$NC" "$1" "$(readlink "$1")"
62+
printf ' Symlink %s exists -> %s\n' "$1" "$(readlink "$1")"
6963
return 0
7064
else
71-
printf '%s✗%s Symlink %s is missing\n' "$RED" "$NC" "$1"
65+
printf ' Symlink %s is missing\n' "$1"
7266
return 1
7367
fi
7468
}
@@ -108,9 +102,9 @@ ENV_FILE="/boot/config/plugins/dynamix.my.servers/env"
108102
echo "Checking configuration files..."
109103
CONFIG_ERRORS=0
110104
if [ -f "$ENV_FILE" ]; then
111-
printf '%s✓%s Environment file %s exists\n' "$GREEN" "$NC" "$ENV_FILE"
105+
printf ' Environment file %s exists\n' "$ENV_FILE"
112106
else
113-
printf '%s✗%s Environment file %s is missing\n' "$RED" "$NC" "$ENV_FILE"
107+
printf ' Environment file %s is missing\n' "$ENV_FILE"
114108
CONFIG_ERRORS=$((CONFIG_ERRORS + 1))
115109
fi
116110
TOTAL_ERRORS=$((TOTAL_ERRORS + CONFIG_ERRORS))
@@ -123,46 +117,46 @@ SHUTDOWN_ERRORS=0
123117
echo "Checking for shutdown scripts in rc6.d..."
124118
if [ -f "/etc/rc.d/rc.flash_backup" ]; then
125119
if [ -x "/etc/rc.d/rc6.d/K10flash-backup" ]; then
126-
printf '%s✓%s Shutdown script for flash_backup exists and is executable\n' "$GREEN" "$NC"
120+
printf ' Shutdown script for flash_backup exists and is executable\n'
127121
else
128-
printf '%s✗%s Shutdown script for flash_backup missing or not executable\n' "$RED" "$NC"
122+
printf ' Shutdown script for flash_backup missing or not executable\n'
129123
SHUTDOWN_ERRORS=$((SHUTDOWN_ERRORS + 1))
130124
fi
131125
fi
132126

133127
# Check for unraid-api shutdown script
134128
if [ -x "/etc/rc.d/rc6.d/K20unraid-api" ]; then
135-
printf '%s✓%s Shutdown script for unraid-api exists and is executable\n' "$GREEN" "$NC"
129+
printf ' Shutdown script for unraid-api exists and is executable\n'
136130
else
137-
printf '%s✗%s Shutdown script for unraid-api missing or not executable\n' "$RED" "$NC"
131+
printf ' Shutdown script for unraid-api missing or not executable\n'
138132
SHUTDOWN_ERRORS=$((SHUTDOWN_ERRORS + 1))
139133
fi
140134

141135
# Check for rc0.d symlink or directory
142136
if [ -L "/etc/rc.d/rc0.d" ]; then
143-
printf '%s✓%s rc0.d symlink exists\n' "$GREEN" "$NC"
137+
printf ' rc0.d symlink exists\n'
144138
elif [ -d "/etc/rc.d/rc0.d" ]; then
145-
printf '%s✓%s rc0.d directory exists\n' "$GREEN" "$NC"
139+
printf ' rc0.d directory exists\n'
146140
else
147-
printf '%s✗%s rc0.d symlink or directory missing\n' "$RED" "$NC"
141+
printf ' rc0.d symlink or directory missing\n'
148142
SHUTDOWN_ERRORS=$((SHUTDOWN_ERRORS + 1))
149143
fi
150144

151145
TOTAL_ERRORS=$((TOTAL_ERRORS + SHUTDOWN_ERRORS))
152146

153147
# Check if unraid-api is in path
154148
if command -v unraid-api >/dev/null 2>&1; then
155-
printf '%s✓%s unraid-api is in PATH\n' "$GREEN" "$NC"
149+
printf ' unraid-api is in PATH\n'
156150
else
157-
printf '%s⚠%s unraid-api is not in PATH\n' "$YELLOW" "$NC"
151+
printf ' unraid-api is not in PATH\n'
158152
TOTAL_ERRORS=$((TOTAL_ERRORS + 1))
159153
fi
160154

161155
# Log file check
162156
if [ -f "/var/log/unraid-api/dynamix-unraid-install.log" ]; then
163-
printf '%s✓%s Installation log file exists\n' "$GREEN" "$NC"
157+
printf ' Installation log file exists\n'
164158
else
165-
printf '%s⚠%s Installation log file not found\n' "$YELLOW" "$NC"
159+
printf ' Installation log file not found\n'
166160
fi
167161

168162
# Summary
@@ -176,11 +170,11 @@ echo "- Shutdown configuration errors: $SHUTDOWN_ERRORS"
176170
echo "- Total errors: $TOTAL_ERRORS"
177171

178172
if [ $TOTAL_ERRORS -eq 0 ]; then
179-
printf '%sAll checks passed successfully.%s\n' "$GREEN" "$NC"
173+
printf 'All checks passed successfully.\n'
180174
echo "Installation verification completed successfully."
181175
exit 0
182176
else
183-
printf '%sFound %d total errors.%s\n' "$RED" "$TOTAL_ERRORS" "$NC"
177+
printf 'Found %d total errors.\n' "$TOTAL_ERRORS"
184178
echo "Installation verification completed with issues."
185179
echo "See log file for details: /var/log/unraid-api/dynamix-unraid-install.log"
186180
# We don't exit with error as this is just a verification script

0 commit comments

Comments
 (0)