This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
yubi-lock/yubi_lock/install/cli.py

14 lines
484 B
Python
Raw Normal View History

2016-05-19 14:20:32 +01:00
import click
import os
2016-05-19 19:56:15 +01:00
from yubi_lock.api import BASE_DIR
2016-05-19 14:20:32 +01:00
@click.command('install', short_help='Install required files for insertion detection')
2016-05-19 19:56:15 +01:00
def cli():
2016-05-19 22:24:55 +01:00
exit_code = os.system("sudo cp {} {}".format(BASE_DIR + "/data/85-yubikey-screen-lock.rules", "/etc/udev/rules.d/85-yubikey-screen-lock.rules"))
2016-05-19 19:56:15 +01:00
if exit_code == 0:
2016-05-19 22:24:55 +01:00
print('Export complete! Refreshing...')
os.system("sudo udevadm control --reload-rules")
2016-05-19 19:56:15 +01:00
else:
print('Something went wrong!')