summaryrefslogtreecommitdiffstats
path: root/scripts/install-lss.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 16:37:15 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 16:37:15 +0000
commitae5d181b854d3ccb373b6bc01b4869e44ff4d87a (patch)
tree91f59efb48c56a84cc798e012fccb667b63d3fee /scripts/install-lss.sh
parentInitial commit. (diff)
downloadlynx-ae5d181b854d3ccb373b6bc01b4869e44ff4d87a.tar.xz
lynx-ae5d181b854d3ccb373b6bc01b4869e44ff4d87a.zip
Adding upstream version 2.9.0dev.12.upstream/2.9.0dev.12upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts/install-lss.sh')
-rwxr-xr-xscripts/install-lss.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/scripts/install-lss.sh b/scripts/install-lss.sh
new file mode 100755
index 0000000..eb9694a
--- /dev/null
+++ b/scripts/install-lss.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+# $LynxId: install-lss.sh,v 1.2 2021/01/07 00:32:39 tom Exp $
+# install lynx.lss, ensuring the old config-file is saved to a backup file.
+#
+# $1 = install program
+# $2 = file to install
+# $3 = where to install it
+PRG="$1"
+SRC=$2
+DST=$3
+
+if test -f "$DST" ; then
+ # See if we have saved this information before
+ if cmp -s "$SRC" "$DST"
+ then
+ echo "... installed $DST would not be changed"
+ else
+ NUM=1
+ while test -f "${DST}-${NUM}"
+ do
+ if cmp -s "$SRC" "${DST}-${NUM}"
+ then
+ break
+ fi
+ NUM=`expr "$NUM" + 1`
+ done
+ if test ! -f "${DST}-${NUM}"
+ then
+ echo "... saving old config as ${DST}-${NUM}"
+ mv "$DST" "${DST}-${NUM}" || exit 1
+ fi
+ echo "** installing $SRC as $DST"
+ eval "$PRG" "$SRC" "$DST" || exit 1
+ fi
+else
+ echo "** installing $SRC as $DST"
+ eval "$PRG" "$SRC" "$DST" || exit 1
+fi