You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

getRulebase.in 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/bin/sh
  2. #
  3. # Script to download a rulebase for SNFServer.
  4. #
  5. # Copyright (C) 2008 by MicroNeil Corporation. All rights reserved.
  6. ## See www.armresearch.com for the copyright terms.
  7. #
  8. #
  9. # Replace authenticationxx and licensid with your license info.
  10. #
  11. SNIFFER_PATH=PREFIX/share/PACKAGE_NAME
  12. SNF2CHECK=PREFIX/sbin/SNF2Check
  13. AUTHENTICATION=authenticationxx
  14. LICENSE_ID=licenseid
  15. #
  16. # Do not modify anything below this line.
  17. #
  18. STATUS_FILE_NAME=getRulebase.status
  19. cd $SNIFFER_PATH
  20. if [ -e UpdateReady.txt ] && [ ! -e UpdateReady.lck ]; then
  21. # Uncomment the following line if more than one process might
  22. # launch this script. Leave it commented out if this script will
  23. # normally be run by the <update-script/> mechanism in SNFServer.
  24. # touch UpdateReady.lck
  25. rm -f $STATUS_FILE_NAME
  26. curl http://www.sortmonster.net/Sniffer/Updates/$LICENSE_ID.snf --output $LICENSE_ID.new --compressed --user sniffer:ki11sp8m --remote-time --fail
  27. $SNF2CHECK $LICENSE_ID.new $AUTHENTICATION
  28. RETVAL=$?
  29. if [ $RETVAL -eq 0 ]; then
  30. if [ -e $LICENSE_ID.old ]; then rm -f $LICENSE_ID.old; fi
  31. if [ -e $LICENSE_ID.snf ]; then mv $LICENSE_ID.snf $LICENSE_ID.old; fi
  32. mv $LICENSE_ID.new $LICENSE_ID.snf
  33. if [ -e UpdateReady.txt ]; then rm -f UpdateReady.txt; fi
  34. if [ -e UpdateReady.lck ]; then rm -f UpdateReady.lck; fi
  35. echo Success > $STATUS_FILE_NAME
  36. else
  37. if [ -e $LICENSE_ID.new ]; then rm -f $LICENSE_ID.new; fi
  38. if [ -e UpdateReady.lck ]; then rm -f UpdateReady.lck; fi
  39. echo Failure > $STATUS_FILE_NAME
  40. fi
  41. fi