0
0
Fork 0
mirror of https://github.com/boltgolt/howdy.git synced 2024-09-19 09:51:19 +02:00

Added command autocomplete

This commit is contained in:
boltgolt 2018-02-10 17:03:42 +01:00
parent 494e414949
commit 7421eac023
2 changed files with 18 additions and 0 deletions

12
autocomplete.sh Normal file
View file

@ -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

View file

@ -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): for line in fileinput.input(["/lib/security/howdy/config.ini"], inplace = 1):
print(line.replace("device_id = 1", "device_id = " + picked), end="") 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)) 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(["ln -s /lib/security/howdy/cli.py /usr/bin/howdy"], shell=True))
handleStatus(subprocess.call(["chmod +x /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") log("Adding howdy as PAM module")
outlines = [] outlines = []