#!/opt/conda/bin/python
# -*- coding: utf-8 -*-
import re
import sys
import time

from jupyterhub.singleuser import main
from subprocess import Popen, DEVNULL

if __name__ == '__main__':
    Popen(['nohup', './.init/spawn.sh'], stdout=DEVNULL, stderr=DEVNULL)
    time.sleep(30)
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(main())
