mirror of
https://github.com/craigerl/aprsd.git
synced 2025-06-17 05:42:36 -04:00
commit
26ca8563f9
24
aprsd.py
24
aprsd.py
@ -323,21 +323,22 @@ def send_email(to_addr, content):
|
|||||||
|
|
||||||
|
|
||||||
### main() ###
|
### main() ###
|
||||||
try:
|
def main():
|
||||||
|
try:
|
||||||
tn = telnetlib.Telnet(HOST, 14580)
|
tn = telnetlib.Telnet(HOST, 14580)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print "Telnet session failed.\n"
|
print "Telnet session failed.\n"
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
||||||
tn.write("user " + USER + " pass " + PASS + " vers aprsd 0.99\n" )
|
tn.write("user " + USER + " pass " + PASS + " vers aprsd 0.99\n" )
|
||||||
|
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
||||||
check_email_thread() # start email reader thread
|
check_email_thread() # start email reader thread
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
line = ""
|
line = ""
|
||||||
try:
|
try:
|
||||||
for char in tn.read_until("\n",100):
|
for char in tn.read_until("\n",100):
|
||||||
@ -464,7 +465,6 @@ while True:
|
|||||||
reply = "Unable to find you (send beacon?)"
|
reply = "Unable to find you (send beacon?)"
|
||||||
send_message(fromcall, reply)
|
send_message(fromcall, reply)
|
||||||
|
|
||||||
|
|
||||||
# USAGE
|
# USAGE
|
||||||
else:
|
else:
|
||||||
reply = "usage: time, fortune, loc, weath, -emailaddr emailbody, -#(resend)"
|
reply = "usage: time, fortune, loc, weath, -emailaddr emailbody, -#(resend)"
|
||||||
@ -480,8 +480,10 @@ while True:
|
|||||||
#sys.exit(1) # merely a suggestion
|
#sys.exit(1) # merely a suggestion
|
||||||
os._exit(1)
|
os._exit(1)
|
||||||
|
|
||||||
# end while True
|
# end while True
|
||||||
|
tn.close()
|
||||||
|
exit()
|
||||||
|
|
||||||
tn.close()
|
|
||||||
|
|
||||||
exit()
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user