To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 92628006 authored by Reto Da Forno's avatar Reto Da Forno

script fixed

git-svn-id: svn://svn.ee.ethz.ch/flocklab/trunk/shared@3338 613144d5-4475-0410-9df3-888732ad2c88
parent c7aba1f0
......@@ -37,17 +37,19 @@ if __name__ == "__main__":
print "could not connect to database: " + sys.exc_info()[1][0]
sys.exit()
elif len(sys.argv) != 3:
elif len(sys.argv) == 3:
r = re.split('[ ,;]+', sys.argv[2])
if not '@' in r[0]:
print "invalid email address"
sys.exit()
else:
print "Usage: ./%s [subject] [recipients] < [filename]" % scriptname
sys.exit()
msg = sys.stdin.read()
print "mail content:\n" + msg
s = sys.argv[1]
r = re.split('[ ,;]+', sys.argv[2])
if not '@' in r[0]:
print "invalid email address"
sys.exit()
sys.stdout.write("sending mail with subject '" + s + "' to " + str(len(r)) + " recipient(s) in ")
sys.stdout.flush()
try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment