archive
/
yubi-lock
Archived
1
Fork 0

fix install

This commit is contained in:
Jake Howard 2016-05-19 19:56:15 +01:00
parent 44eb3bbe7d
commit 595f2d0d1a
1 changed files with 7 additions and 10 deletions

View File

@ -1,15 +1,12 @@
import click
from sh import sudo
import os
BASE_DIR = os.path.dirname(os.path.realpath(__file__))
from yubi_lock.api import BASE_DIR
@click.command('install', short_help='Install required files for insertion detection')
@click.option('-v', '--verbose')
def cli(verbose):
if verbose:
print("Exporting UDEV rule...")
sudo.cp(BASE_DIR + "../data/85-yubikey-screen-lock.rules", "/etc/udev/rules.d/85-yubikey-screen-lock.rules")
print('Export complete!')
def cli():
exit_code = os.system("sudo cp {} {}".format(BASE_DIR + "../data/85-yubikey-screen-lock.rules", "/etc/udev/rules.d/85-yubikey-screen-lock.rules"))
if exit_code == 0:
print('Export complete!')
else:
print('Something went wrong!')