|
|
@@ -29,12 +29,15 @@
|
|
|
# Custombuild switch , set to 1 if you are using it.
|
|
|
CustomBuild=1
|
|
|
|
|
|
+# Service Name
|
|
|
+SERVICENAME="DirectAdmin"
|
|
|
+
|
|
|
#####################################################################
|
|
|
# DO NOT CHANGE BELOW UNLESS YOU EXACTLY KNOW WHAT YOU ARE DOING #
|
|
|
#####################################################################
|
|
|
|
|
|
# Define global path of directAdmin
|
|
|
-if [ $CustomBuild -eq 1 ]
|
|
|
+if [[ "$CustomBuild" -eq 1 ]]
|
|
|
then
|
|
|
DirAdmin_Path="/usr/local/directadmin/custombuild"
|
|
|
else
|
|
|
@@ -42,15 +45,15 @@ else
|
|
|
fi
|
|
|
|
|
|
# store version information from DirectAdmin packages
|
|
|
-DirectAdmin_Versions_Update=$($DirAdmin_Path/build versions)
|
|
|
+DirectAdmin_Versions_Update=$("$DirAdmin_Path"/build versions)
|
|
|
# Define updates Array
|
|
|
updates=()
|
|
|
# Iterate over the collected data to find possible updates
|
|
|
while read -r line; do
|
|
|
- if [[ $line =~ ^Latest\ version\ of\ (.+):\ (.+)$ ]]; then
|
|
|
+ if [[ "$line" =~ ^Latest\ version\ of\ (.+):\ (.+)$ ]]; then
|
|
|
component="${BASH_REMATCH[1]}"
|
|
|
latest="${BASH_REMATCH[2]}"
|
|
|
- elif [[ $line =~ ^Installed\ version\ of\ (.+):\ (.+)$ ]]; then
|
|
|
+ elif [[ "$line" =~ ^Installed\ version\ of\ (.+):\ (.+)$ ]]; then
|
|
|
installed="${BASH_REMATCH[2]}"
|
|
|
|
|
|
# Compare versions using sort -V
|
|
|
@@ -65,5 +68,5 @@ if [[ ${#updates[@]} -eq 0 ]]; then
|
|
|
echo "0 \"DirectAdmin\" - All DirectAdmin Versions are up to date"
|
|
|
else
|
|
|
update_list=$(IFS=,; echo "${updates[*]}")
|
|
|
- echo "1 \"DirectAdmin\" - DirectAdmin Versions ${update_list} have updates"
|
|
|
+ echo "1 \"$SERVICE\" - $SERVICE Versions ${update_list} have updates"
|
|
|
fi
|