OpenBTS/debian/preinst
Kurtis Heimerl 5289a229d9 sync of openbts
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6168 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-08-14 00:52:14 +00:00

53 lines
1 KiB
Bash
Executable file

#!/bin/sh
# preinst script for test
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <new-preinst> `install'
# * <new-preinst> `install' <old-version>
# * <new-preinst> `upgrade' <old-version>
# * <old-preinst> `abort-upgrade' <new-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
install()
{
INSTALL_DIR=/OpenBTS
DATE=$(date +'%Y-%m-%d.%H:%M:%S')
BACKUP_DIR=$INSTALL_DIR/backup_$DATE
if [ -f $INSTALL_DIR/OpenBTS -a -f $INSTALL_DIR/transceiver ]; then
if [ ! -e $BACKUP_DIR ]; then
mkdir -p $BACKUP_DIR/
mv $INSTALL_DIR/OpenBTS $BACKUP_DIR/
mv $INSTALL_DIR/transceiver $BACKUP_DIR/
fi
fi
}
case "$1" in
install|upgrade)
install
;;
abort-upgrade)
;;
*)
echo "preinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0