Created
February 8, 2016 18:40
-
-
Save bigeagle/924814b4ffd0733db2ca to your computer and use it in GitHub Desktop.
Along with udevedu, reload gpg scdaemon on yubikey insert
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/env python2 | |
# -*- coding:utf-8 -*- | |
from __future__ import print_function, division, unicode_literals | |
from udevedu.utils import invoke | |
def init(): | |
print("Monitor Yubikey NEO") | |
def check(action, device): | |
# print(action, device.items()) | |
return ( | |
device.get('ID_VENDOR_ID') == '1050' and | |
device.get('ID_MODEL_ID') == '0111' and | |
device.get('DEVNAME', '').startswith('/dev/input/event') | |
) | |
cmd = 'gpgconf --reload scdaemon'.split() | |
def react(action, device): | |
print("reload gpg scdaemon") | |
invoke(*cmd) | |
# print(action, device.items(), device) | |
# vim: ts=4 sw=4 sts=4 expandtab |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment