diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2007-05-13 23:54:37 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2007-05-13 23:54:37 -0400 |
commit | cdf342faa36bbeea0fe2d8519d5b17f4b072f7f6 (patch) | |
tree | a84d747c5ffecaf8cda6424d36583905f42eda99 /scripts/install-lss.sh | |
parent | 741e82fc69b69a3bfc14f33f33766a89cea4df42 (diff) | |
download | lynx-snapshots-cdf342faa36bbeea0fe2d8519d5b17f4b072f7f6.tar.gz |
snapshot of project "lynx", label v2-8-7dev_4e
Diffstat (limited to 'scripts/install-lss.sh')
-rwxr-xr-x | scripts/install-lss.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/scripts/install-lss.sh b/scripts/install-lss.sh new file mode 100755 index 00000000..6573a35e --- /dev/null +++ b/scripts/install-lss.sh @@ -0,0 +1,38 @@ +#!/bin/sh +# $LynxId: install-lss.sh,v 1.1 2007/05/13 22:15:29 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 |