summaryrefslogtreecommitdiffstats
path: root/satellit_upgrader/pack-update.sh
diff options
context:
space:
mode:
authorSimon Rettberg2019-03-28 09:57:21 +0100
committerSimon Rettberg2019-03-28 09:57:21 +0100
commit0c866dd8933971da0568958e7caa2693df37bd89 (patch)
tree491e477621be340137da6fb7f3de4e4be122625d /satellit_upgrader/pack-update.sh
parent[SSPS] slx-admin boot: Also log non-critical messages (diff)
downloadsetup-scripts-0c866dd8933971da0568958e7caa2693df37bd89.tar.gz
setup-scripts-0c866dd8933971da0568958e7caa2693df37bd89.tar.xz
setup-scripts-0c866dd8933971da0568958e7caa2693df37bd89.zip
[SSUS] Require manual --version spec
Diffstat (limited to 'satellit_upgrader/pack-update.sh')
-rwxr-xr-xsatellit_upgrader/pack-update.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/satellit_upgrader/pack-update.sh b/satellit_upgrader/pack-update.sh
index a485baf..a44265e 100755
--- a/satellit_upgrader/pack-update.sh
+++ b/satellit_upgrader/pack-update.sh
@@ -104,12 +104,17 @@ readonly RED GREEN RESET
cp "updater.template.sh" "$UPDATER" || perror "could not copy template"
chmod +x "$UPDATER"
+VERSION=
LEAN=
while true; do
case "$1" in
--lean|-l)
LEAN=true
;;
+ --version)
+ shift
+ VERSION="$1"
+ ;;
*)
break
;;
@@ -117,6 +122,9 @@ while true; do
shift
done
+[ -z "$VERSION" ] && perror "No --version given"
+[[ "$VERSION" =~ ^v[0-9]\.[0-9][a-z]?$ ]] || echo "${RED}Warn${RESET}: Version format is not vX.X(y)"
+
# Prepare source directory
declare -rg SRCDIR=$1
if [ -z "$SRCDIR" ]; then
@@ -185,7 +193,7 @@ if [ -e "$TGZ_SLXADMIN" ]; then
[ -n "$VERS" ] || perror "Could not extract slx-admin version!"
echo "Version: $VERS"
sed -i "s/%TARGET_WEBIF_VERSION%/${VERS}/" "$UPDATER" || perror "could not patch slxadmin version in updater"
- sed -i "s/%SLXADMIN_FOOTER%/$(date '+%y-%m-%d %H:%M')/" "$UPDATER" || perror "could not patch slxadmin footer in updater"
+ sed -i "s/%SLXADMIN_FOOTER%/${VERSION}/" "$UPDATER" || perror "could not patch slxadmin footer in updater"
patchtgz "TGZ_SLXADMIN" "$TGZ_SLXADMIN"
else
echo "${RED}no${RESET}"