Ejemplo n.º 1
0
def isenablesystem():
    product = getproductdetails(app)
    http = urllib3.PoolManager()
    r = http.request(
        'GET', 'http://' + product['productip'] + ':' + product['serverport'] +
        '/isenablesystem?secretkey=' + product['secretkey'])
    return make_response(r.data.decode('utf-8'))
Ejemplo n.º 2
0
 def show_monitoringpage(app):
     product = getproductdetails(app)
     execute_command_remotely(hostname=product['productip'],
                              username=product['username'],
                              password=product['password'],
                              command='sudo modprobe bcm2835-v4l2')
     return render_template('monitoring.html',
                            title="Monitoring",
                            app=app,
                            productip=product['productip'],
                            motionport=product['motionport'])
Ejemplo n.º 3
0
def startserver():
    product = getproductdetails(app)
    command = 'cd ' + os.path.join(product['serverdir'],
                                   'Antitheft-Client') + ';python3 main.py'

    def executecommandserver():
        execute_command_remotely(hostname=product['productip'],
                                 username=product['username'],
                                 password=product['password'],
                                 command=command)

    Process(target=executecommandserver).start()
    return make_response('success')