add a flag, --gopherhost
This commit is contained in:
parent
bc1d100297
commit
252c63a0d5
6
esgd.py
6
esgd.py
|
@ -42,7 +42,7 @@ class GopherLine:
|
||||||
|
|
||||||
try: self.host = split[2]
|
try: self.host = split[2]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
if location == True: self.host = host
|
if location == True: self.host = ghost
|
||||||
|
|
||||||
try: self.port = split[3]
|
try: self.port = split[3]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
|
@ -222,6 +222,8 @@ def parseArgs():
|
||||||
help="group to change to on startup")
|
help="group to change to on startup")
|
||||||
parse.add_argument("-s", "--host", default="localhost",
|
parse.add_argument("-s", "--host", default="localhost",
|
||||||
help="host to host on")
|
help="host to host on")
|
||||||
|
parse.add_argument("-gs", "--gopherhost", default=None,
|
||||||
|
help="host defaulted to in links on gophermaps")
|
||||||
parse.add_argument("-p", "--port", default=70, type=int,
|
parse.add_argument("-p", "--port", default=70, type=int,
|
||||||
help="port to host on")
|
help="port to host on")
|
||||||
parse.add_argument("-d", "--dir", default="/var/gopher",
|
parse.add_argument("-d", "--dir", default="/var/gopher",
|
||||||
|
@ -240,11 +242,13 @@ if __name__ == "__main__":
|
||||||
switchgrp = grp.getgrnam(args.group).gr_gid
|
switchgrp = grp.getgrnam(args.group).gr_gid
|
||||||
switchusr = pwd.getpwnam(args.user).pw_uid
|
switchusr = pwd.getpwnam(args.user).pw_uid
|
||||||
host = args.host
|
host = args.host
|
||||||
|
ghost = args.gopherhost
|
||||||
port = args.port
|
port = args.port
|
||||||
location = args.dir
|
location = args.dir
|
||||||
exempt = args.direxc
|
exempt = args.direxc
|
||||||
nocgi = args.nocgi
|
nocgi = args.nocgi
|
||||||
log.log("arguments good")
|
log.log("arguments good")
|
||||||
|
if ghost == None: ghost = host
|
||||||
try:
|
try:
|
||||||
with TCPServer((host, port), GopherHandler) as server:
|
with TCPServer((host, port), GopherHandler) as server:
|
||||||
os.setgid(switchgrp)
|
os.setgid(switchgrp)
|
||||||
|
|
Loading…
Reference in New Issue