going-flying.com gemini git repository
568432eb460ced058701fd8549ddbfdb4b3421b0 - Matthew Ernisse - 1595859576
script path
diff --git a/cgi-bin/bofh.py b/cgi-bin/bofh.py index 555ab58..173a155 100755 --- a/cgi-bin/bofh.py +++ b/cgi-bin/bofh.py @@ -42,13 +42,17 @@ import sys if __name__ == '__main__': - if not os.path.exists('excuses'): + fn = os.path.dirname(os.environ['SCRIPT_PATH']) + fn = os.path.join(fn, 'excuses') + + if not os.path.exists(fn): print('20 text/plain\r\n') print('What home directory?') sys.exit() try: - with open('excuses') as fd: + + with open(fn) as fd: excuses = fd.readlines() except Exception: print('20 text/plain\r\n')