Last active
December 19, 2015 18:49
-
-
Save altipard/b958dc6bcae8b69a36a3 to your computer and use it in GitHub Desktop.
Remote Reboot Auerswald 5010 Telefonanlage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| __author__ = "Daniel Altiparmak (sixfinger78@gmail.com)" | |
| __copyright__ = "Copyright (C) 2015 Daniel Altiparmak" | |
| __license__ = "GPL 3.0" | |
| """ | |
| This snippet is used to reboot the telephone system Auerswald. | |
| It depends on the requests package, which must be installed. | |
| See http://docs.python-requests.org/en/latest/user/install/ | |
| To execute the snippet, admin user must not be logged in! | |
| It is tested on an Auerswald 5010. This snippet may also works on other Auerswald platforms. | |
| Feedback is desired! | |
| """ | |
| import requests | |
| ip_adress = 'ip_address' # ip address e.g 192.168.2.2 | |
| admin_user = 'admin' # Admin Account | |
| admin_pass = 'your_password' # Password | |
| LOGIN_URL = 'http://%s/login_json' % ip_adress | |
| REBOOT_URL = 'http://%s/updownload_reboot_time_pbx?reboottime=0' % ip_adress | |
| cookies = {'AUERSessionID': ', AUERWEB_COOKIE=admin'} | |
| data = 'LOGIN_NOW=&LOGIN_NAME=%s&LOGIN_PASS=%s' % (admin_user, admin_pass) | |
| with requests.Session() as s: | |
| s.post( | |
| LOGIN_URL, | |
| cookies=cookies, | |
| data=data | |
| ) | |
| s.post( | |
| REBOOT_URL | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment