Onionr/onionr/utils/gethostname.py

10 lines
301 B
Python
Raw Normal View History

2019-07-30 05:19:22 +00:00
from . import identifyhome
import filepaths
def get_hostname():
try:
with open(identifyhome.identify_home() + '/hs/hostname', 'r') as hostname:
return hostname.read().strip()
except FileNotFoundError:
return "Not Generated"
except Exception:
return None