|
|
CONFIGFILE=/etc/suspend.conf | CONFIGFILE=/etc/suspend.conf |
INITDIR=/etc/init.d | INITDIR=/etc/init.d |
RLVLDIR=/etc/init.d | RLVLDIR=/etc/init.d |
INSTALLDIR=/usr/local/sbin |
INSTALLDIR=${PREFIX}/sbin |
IFDOWN=/etc/init.d/net.eth0 | IFDOWN=/etc/init.d/net.eth0 |
OPTDOWN=stop | OPTDOWN=stop |
IFUP=/etc/init.d/net.eth0 | IFUP=/etc/init.d/net.eth0 |
|
|
} ' $0 >> $TMP | } ' $0 >> $TMP |
| |
if [ ! -d $INSTALLDIR ] ;then | if [ ! -d $INSTALLDIR ] ;then |
echo "Directory $INSTALLDIR doesn't exist: installation aborted" |
mkdir -p "${INSTALLDIR}" |
rm $TMP |
|
exit 2 |
|
fi | fi |
| |
echo "Creating $INSTALLDIR/$BINNAME" | echo "Creating $INSTALLDIR/$BINNAME" |
|
|
SWSUSP_VT="9" | SWSUSP_VT="9" |
EOF | EOF |
if [ ! -f $CONFIGFILE -o "$FORCE" = "yes" ] ;then | if [ ! -f $CONFIGFILE -o "$FORCE" = "yes" ] ;then |
echo "Creating file $CONFIGFILE" |
echo "Creating file ${PREFIX}/${CONFIGFILE}" |
mv $TMP $CONFIGFILE |
mkdir -p $(dirname "${PREFIX}/${CONFIGFILE}") |
|
mv "${TMP}" "${PREFIX}/${CONFIGFILE}" |
else | else |
echo "Configuration file $CONFIGFILE exists: not overwritten" | echo "Configuration file $CONFIGFILE exists: not overwritten" |
echo -e "These are the differences:\n" | echo -e "These are the differences:\n" |
diff -u $CONFIGFILE $TMP | diff -u $CONFIGFILE $TMP |
echo "Creating file $CONFIGFILE.new" |
echo "Creating file ${PREFIX}/${CONFIGFILE}.new" |
mv $TMP $CONFIGFILE.new |
mkdir -p $(dirname "${PREFIX}/${CONFIGFILE}.new") |
|
mv "${TMP}" "${PREFIX}/${CONFIGFILE}.new" |
fi | fi |
| |
exit 0 | exit 0 |