octoprint-klipper-docker/udev/printer-connected

21 lines
315 B
Plaintext
Raw Normal View History

2018-06-03 22:27:11 +00:00
#!/usr/bin/env python
import time
import os
logf = open('/var/tmp/printer-connected.log', 'a')
DEVNAME = os.environ['DEVNAME']
def log(msg):
logf.write('%s\n' % (msg,))
def main():
log(time.asctime())
log(DEVNAME)
os.system('chmod a+wr %s' % (DEVNAME,))
if __name__ == '__main__':
main()