diff --git a/autocomplete.sh b/autocomplete.sh new file mode 100644 index 0000000..117ba6e --- /dev/null +++ b/autocomplete.sh @@ -0,0 +1,12 @@ +_howdy() { + local cur prev opts + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + opts="help list add remove clear" + + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + return 0 +} + +complete -F _howdy howdy diff --git a/installer.py b/installer.py index 2004fa0..db1a38c 100644 --- a/installer.py +++ b/installer.py @@ -81,10 +81,16 @@ handleStatus(subprocess.call(["git", "clone", "https://github.com/Boltgolt/howdy for line in fileinput.input(["/lib/security/howdy/config.ini"], inplace = 1): print(line.replace("device_id = 1", "device_id = " + picked), end="") +# Secure the howdy folder handleStatus(subprocess.call(["chmod 600 -R /lib/security/howdy/"], shell=True)) + +# Make the CLI executable as howdy handleStatus(subprocess.call(["ln -s /lib/security/howdy/cli.py /usr/bin/howdy"], shell=True)) handleStatus(subprocess.call(["chmod +x /usr/bin/howdy"], shell=True)) +# Install the command autocomplete +handleStatus(subprocess.call(["sudo cp /lib/security/howdy/autocomplete.sh /etc/bash_completion.d/howdy"], shell=True)) + log("Adding howdy as PAM module") outlines = []