Example #1
0
def run():
    if not util.is_supported():
        print('Sorry, your OS is not supported.')
        if util.on_windows and not util.on_wsl:
            print('Please make sure you are running on a WSL2 shell.')
        return 1

    opt = parser.parse_args()
    run_status = 0
    try:
        if opt.COMMAND == 'show-domain':
            run_status = show_domain.main()

        elif opt.COMMAND == 'install':
            super_check()
            output = install.main(name=opt.name, tag=opt.tag, tld=opt.tld)
            if output == 0:
                print(f'Now you can run "{sys.argv[0]} status" to verify')
            run_status = output

        elif opt.COMMAND == 'uninstall':
            super_check()
            run_status = uninstall.main()

        elif opt.COMMAND == 'tunnel':
            super_check()
            run_status = tunnel.connect()

        else:
            run_status = status.main()
        return run_status

    except Fatal as e:
        print(f'fatal: {e}')
        return 1
    except KeyboardInterrupt:
        print('Keyboard interrupt: exiting.')
        return 1
Example #2
0
import sys

import eventlet

import tunnel

client = tunnel.get_sshclient('bastion.server',
                              username='******',
                              password='******')
tunnel = tunnel.connect('123.45.67.89', 445, client)
tunnel.serve_forever()
print "tunnel is running on %s !" % tunnel.address

if len(sys.argv) > 1:
    n = sys.argv[1]
else:
    n = 50

for x in range(n):
    sys.stdout.write('.')
    sys.stdout.flush()
    eventlet.sleep(1)
Example #3
0
 def create_tunnel(self):
     self.ssh_tunnel = tunnel.connect(self.host, self.port, self.bastion)
     self._orig_host = self.host
     self._orig_port = self.port
     self.host, self.port = self.ssh_tunnel.address
     self.ssh_tunnel.serve_forever(async=True)
Example #4
0
File: pse.py Project: nick-o/satori
 def create_tunnel(self):
     self.ssh_tunnel = tunnel.connect(self.host, self.port, self.gateway)
     self._orig_host = self.host
     self._orig_port = self.port
     self.host, self.port = self.ssh_tunnel.address
     self.ssh_tunnel.serve_forever(async=True)
Example #5
0
import sys

import eventlet

import tunnel


client = tunnel.get_sshclient('bastion.server', username='******', password='******')
tunnel = tunnel.connect('123.45.67.89', 445, client)
tunnel.serve_forever()
print "tunnel is running on %s !" % tunnel.address

if len(sys.argv) > 1:
    n = sys.argv[1]
else:
    n = 50

for x in range(n):
    sys.stdout.write('.')
    sys.stdout.flush()
    eventlet.sleep(1)