Skip to content
Snippets Groups Projects
Commit 8a702ac7 authored by kpetersn's avatar kpetersn
Browse files

Allow more than 4 args to be passed. Added test script.

parent a211965d
No related branches found
No related tags found
No related merge requests found
...@@ -45,8 +45,14 @@ def main(args): ...@@ -45,8 +45,14 @@ def main(args):
# Alive XML page # Alive XML page
alive_xml_url = "http://bcda.xray.aps.anl.gov/cgi-bin/alivexml.cgi" alive_xml_url = "http://bcda.xray.aps.anl.gov/cgi-bin/alivexml.cgi"
# Parse args ### Parse args
name, ip, state, mess = args # The following line only works if the number of args is exactly four
#!name, ip, state, mess = args
# The following lines allow Dohn to add arguments without breaking the script
name = args[0]
ip = args[1]
state = args[2]
mess = args[3]
# Get the XLM file # Get the XLM file
try: try:
...@@ -96,7 +102,7 @@ def main(args): ...@@ -96,7 +102,7 @@ def main(args):
if __name__ == '__main__': if __name__ == '__main__':
if len(sys.argv) != 5: if len(sys.argv) < 5:
print "Usage: an_hook.py <iocname> <ip> <status> <user_args>" print "Usage: an_hook.py <iocname> <ip> <status> <user_args>"
#!print sys.argv #!print sys.argv
else: else:
......
#!/bin/bash
echo "I was called:" >> /home/beams/KPETERSN/notifiy-log.txt
echo " $*" >> /home/beams/KPETERSN/notifiy-log.txt
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment