Last active
November 20, 2016 23:08
-
-
Save B17C0D3/76f544a3dc5d11d3c4056a626e4e78df to your computer and use it in GitHub Desktop.
This file contains 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/python | |
# -*- coding: utf-8 -*- | |
# pip install screenutils | |
# pip install git+http://github.com/Christophe31/screenutils.git | |
import logging | |
from screenutils import list_screens, Screen | |
from subprocess import call | |
logging.basicConfig(filename='/media/modem/modem.log', | |
format='%(levelname)s %(asctime)s %(message)s', | |
# level=logging.DEBUG | |
level=logging.INFO) | |
status = 0 | |
for Screen in list_screens(): | |
if Screen.name == "modem": | |
status = 1 | |
if status == 0: | |
logging.debug('Es wird eine neue Screensession gestartet') | |
call(["screen", "-dmS", "modem", "/media/modem/modem.py"]) | |
else: | |
logging.debug('Es läuft bereits eine Screensession') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment