Compare commits
5 Commits
4456653f03
...
5.0-1.21.1
| Author | SHA1 | Date | |
|---|---|---|---|
| e29ca7690a | |||
| fcd24f0387 | |||
| a4d466fe3f | |||
| e42c94cda9 | |||
| 2f1e21f79b |
+19
-4
@@ -25,6 +25,15 @@ okNotify() {
|
|||||||
printf "%s[OK]%s\n" "$ok" "$norm"
|
printf "%s[OK]%s\n" "$ok" "$norm"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
makeDirectory() {
|
||||||
|
if ! [ -d "./$1" ]; then
|
||||||
|
if ! mkdir "./$1" >/dev/null 2>&1; then
|
||||||
|
errMsgString="Unable to make '$1' directory."
|
||||||
|
errMsg "$errMsgString" 40
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
scriptHelp() {
|
scriptHelp() {
|
||||||
textNewline
|
textNewline
|
||||||
textBlock "Update ${containerName} container and helper script files"
|
textBlock "Update ${containerName} container and helper script files"
|
||||||
@@ -196,15 +205,17 @@ if [ "$doScriptUpdate" -eq 1 ]; then
|
|||||||
printf "\n%s*** This script has been updated. Please re-run it to load the updated version of this file. ***%s\n\n" "$warn" "$norm"
|
printf "\n%s*** This script has been updated. Please re-run it to load the updated version of this file. ***%s\n\n" "$warn" "$norm"
|
||||||
# overwrite this script with updated script
|
# overwrite this script with updated script
|
||||||
mv -f ./update.sh.tmp "$localScriptName"
|
mv -f ./update.sh.tmp "$localScriptName"
|
||||||
|
chmod +x "$localScriptName"
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## update files
|
## update files
|
||||||
# ensure directories exist
|
makeDirectory "config"
|
||||||
if ! mkdir config sites snippets >/dev/null 2>&1; then
|
makeDirectory "sites"
|
||||||
errMsg "Unable to make directories in which to place updated files." 40
|
makeDirectory "snippets"
|
||||||
fi
|
|
||||||
while IFS=' ' read -r field1 field2; do
|
while IFS=' ' read -r field1 field2; do
|
||||||
if [ "$field2" = "update.sh" ]; then continue; fi
|
if [ "$field2" = "update.sh" ]; then continue; fi
|
||||||
printf "\nChecking '%s' for updates... " "$field2"
|
printf "\nChecking '%s' for updates... " "$field2"
|
||||||
@@ -243,6 +254,10 @@ if [ "$doScriptUpdate" -eq 1 ]; then
|
|||||||
updateSuccess=$((updateSuccess + 1))
|
updateSuccess=$((updateSuccess + 1))
|
||||||
# overwrite old version of file
|
# overwrite old version of file
|
||||||
mv -f "$updateFilename.tmp" "$updateFilename"
|
mv -f "$updateFilename.tmp" "$updateFilename"
|
||||||
|
if [ "${updateFilename##*.}" = "sh" ]; then
|
||||||
|
# shell file --> make it executable
|
||||||
|
chmod +x "$updateFilename"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user