|
129 | 129 | # Get the binary locations |
130 | 130 | MYSQL=$(command -v mysql) |
131 | 131 | if [ -z "$MYSQL" ]; then |
132 | | - echo "Error: 'mysql' command not found! Please install MySQL or check your PATH." |
| 132 | + printf "Error: 'mysql' command not found! Please install MySQL or check your PATH.\n" |
133 | 133 | exit 1 |
134 | 134 | fi |
135 | 135 |
|
136 | 136 | MYSQLDUMP=$(command -v mysqldump) |
137 | 137 | if [ -z "$MYSQLDUMP" ]; then |
138 | | - echo "Error: 'mysqldump' command not found! Please install MySQL or check your PATH." |
| 138 | + printf "Error: 'mysqldump' command not found! Please install MySQL or check your PATH.\n" |
139 | 139 | exit 1 |
140 | 140 | fi |
141 | 141 |
|
@@ -171,16 +171,24 @@ else |
171 | 171 | printf "\nPlease install curl or wget to check for updates.\n\n" |
172 | 172 | fi |
173 | 173 |
|
174 | | -if [ "$CLIENT_TYPE" = "curl" ]; then |
175 | | - LATEST_VERSION=$("$HTTP_CLIENT" -s --connect-timeout 5 --max-time 5 "$VERSION_URL") |
176 | | -else |
177 | | - LATEST_VERSION=$("$HTTP_CLIENT" -q --connect-timeout=5 --timeout=5 -O - "$VERSION_URL") |
178 | | -fi |
| 174 | +# client has curl or wget installed |
| 175 | +if [ -n "$CLIENT_TYPE" ]; then |
| 176 | + if [ "$CLIENT_TYPE" = "curl" ]; then |
| 177 | + LATEST_VERSION=$("$HTTP_CLIENT" -fs --connect-timeout 5 --max-time 5 "$VERSION_URL") |
| 178 | + else |
| 179 | + LATEST_VERSION=$("$HTTP_CLIENT" -q --connect-timeout=5 --timeout=5 -O - "$VERSION_URL") |
| 180 | + fi |
179 | 181 |
|
180 | | -if [ "$SCRIPT_VER" != "$LATEST_VERSION" ]; then |
181 | | - printf "\nUpdate available! Latest version: %s\n\n" "$LATEST_VERSION" |
182 | | -else |
183 | | - printf "\nYou are running the latest version.\n\n" |
| 182 | + # did we receive a response |
| 183 | + if [ -n "$LATEST_VERSION" ]; then |
| 184 | + if [ "$SCRIPT_VER" != "$LATEST_VERSION" ]; then |
| 185 | + printf "\nUpdate available! Latest version: %s\n\n" "$LATEST_VERSION" |
| 186 | + else |
| 187 | + printf "\nYou are running the latest version.\n\n" |
| 188 | + fi |
| 189 | + else |
| 190 | + printf "\nCould not retrieve the latest version information from the server.\n\n" |
| 191 | + fi |
184 | 192 | fi |
185 | 193 |
|
186 | 194 | # Analyze and Optimze tables |
|
0 commit comments