diff --git a/.gitignore b/.gitignore index 32eb1f5..41d2b22 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ database.db -zshrc.sh # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/README.md b/README.md index 8e5bf5a..a0c292a 100644 --- a/README.md +++ b/README.md @@ -21,22 +21,7 @@ docker run -d -e SECRET_TOKEN=azerty -p 5000:5000 xgaia/command-streamer ### zsh -create a `zshrc.sh` file with the following content - -```zsh -app_url=http://localhost:5000 -secret_token=azerty -function post_command () { - curl -s -X POST ${app_url}/command -H 'token: '${secret_token}'' -H 'Content-Type: application/json' -d '{"command":"'${1}'"}' > /dev/null -} -function reset () { - curl -s ${app_url}/reset -H 'token: '${secret_token}'' > /dev/null -} -autoload -Uz add-zsh-hook -add-zsh-hook preexec post_command -``` - -source the file +source cmd_zsh.sh ```zsh source zshrc.sh diff --git a/cmd_zsh.sh b/cmd_zsh.sh new file mode 100644 index 0000000..e87c1fc --- /dev/null +++ b/cmd_zsh.sh @@ -0,0 +1,10 @@ +app_url=http://localhost:5000 +secret_token=azerty +function post_command () { + curl -s -X POST ${app_url}/command -H 'token: '${secret_token}'' -H 'Content-Type: application/json' -d '{"command":"'${1}'"}' > /dev/null +} +function reset () { + curl -s ${app_url}/reset -H 'token: '${secret_token}'' > /dev/null +} +autoload -Uz add-zsh-hook +add-zsh-hook preexec post_command