Skip to content

Instantly share code, notes, and snippets.

@B17C0D3
Last active November 20, 2016 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save B17C0D3/76f544a3dc5d11d3c4056a626e4e78df to your computer and use it in GitHub Desktop.
Save B17C0D3/76f544a3dc5d11d3c4056a626e4e78df to your computer and use it in GitHub Desktop.
#!/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