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.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/sh
  2. #
  3. # Script to download a rulebase for CGPSNF.
  4. #
  5. # Copyright (C) 2009 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=/var/CommuniGate/CGPSNF
  12. SNF2CHECK=$SNIFFER_PATH/SNF2Check
  13. AUTHENTICATION=authenticationxx
  14. LICENSE_ID=licenseid
  15. #
  16. # Do not modify anything below this line.
  17. #
  18. cd $SNIFFER_PATH
  19. if [ -e UpdateReady.txt ] && [ ! -e UpdateReady.lck ]; then
  20. # Uncomment the following line if more than one process might
  21. # launch this script. Leave it commented out if this script will
  22. # normally be run by the <update-script/> mechanism in CGPSNF
  23. # touch UpdateReady.lck
  24. curl http://www.sortmonster.net/Sniffer/Updates/$LICENSE_ID.snf --output $LICENSE_ID.new --compressed --user sniffer:ki11sp8m --remote-time --fail
  25. $SNF2CHECK $LICENSE_ID.new $AUTHENTICATION
  26. RETVAL=$?
  27. if [ $RETVAL -eq 0 ]; then
  28. if [ -e $LICENSE_ID.old ]; then rm -f $LICENSE_ID.old; fi
  29. if [ -e $LICENSE_ID.snf ]; then mv $LICENSE_ID.snf $LICENSE_ID.old; fi
  30. mv $LICENSE_ID.new $LICENSE_ID.snf
  31. if [ -e UpdateReady.txt ]; then rm -f UpdateReady.txt; fi
  32. if [ -e UpdateReady.lck ]; then rm -f UpdateReady.lck; fi
  33. else
  34. if [ -e $LICENSE_ID.new ]; then rm -f $LICENSE_ID.new; fi
  35. if [ -e UpdateReady.lck ]; then rm -f UpdateReady.lck; fi
  36. fi
  37. fi