#!/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. # 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 mechanism in SNFServer. # touch UpdateReady.lck 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 else if [ -e $LICENSE_ID.new ]; then rm -f $LICENSE_ID.new; fi if [ -e UpdateReady.lck ]; then rm -f UpdateReady.lck; fi fi fi