1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #!/bin/sh
- #
- # Script to download a rulebase for SNFServer.
- #
- # Copyright (C) 2008 by MicroNeil Corporation. All rights reserved.
- ## See www.armresearch.com for the copyright terms.
- #
-
- #
- # Replace authenticationxx and licensid with your license info.
- #
-
- SNIFFER_PATH=PREFIX/share/PACKAGE_NAME
- SNF2CHECK=PREFIX/sbin/SNF2Check
- AUTHENTICATION=authenticationxx
- LICENSE_ID=licenseid
-
- #
- # Do not modify anything below this line.
- #
-
- STATUS_FILE_NAME=getRulebase.status
-
- cd $SNIFFER_PATH
-
- if [ -e UpdateReady.txt ] && [ ! -e UpdateReady.lck ]; then
-
- # Uncomment the following line if more than one process might
- # launch this script. Leave it commented out if this script will
- # normally be run by the <update-script/> mechanism in SNFServer.
- # touch UpdateReady.lck
-
- rm -f $STATUS_FILE_NAME
-
- curl http://www.sortmonster.net/Sniffer/Updates/$LICENSE_ID.snf --output $LICENSE_ID.new --compressed --user sniffer:ki11sp8m --remote-time --fail
-
- $SNF2CHECK $LICENSE_ID.new $AUTHENTICATION
- RETVAL=$?
- if [ $RETVAL -eq 0 ]; then
-
- if [ -e $LICENSE_ID.old ]; then rm -f $LICENSE_ID.old; fi
- if [ -e $LICENSE_ID.snf ]; then mv $LICENSE_ID.snf $LICENSE_ID.old; fi
- mv $LICENSE_ID.new $LICENSE_ID.snf
-
- if [ -e UpdateReady.txt ]; then rm -f UpdateReady.txt; fi
- if [ -e UpdateReady.lck ]; then rm -f UpdateReady.lck; fi
-
- echo Success > $STATUS_FILE_NAME
-
- else
-
- if [ -e $LICENSE_ID.new ]; then rm -f $LICENSE_ID.new; fi
- if [ -e UpdateReady.lck ]; then rm -f UpdateReady.lck; fi
-
- echo Failure > $STATUS_FILE_NAME
-
- fi
- fi
|