diff options
| author | Andrew <saintruler@gmail.com> | 2021-05-22 10:59:18 +0400 |
|---|---|---|
| committer | Andrew <saintruler@gmail.com> | 2021-05-22 10:59:18 +0400 |
| commit | 3fe571af76bef57861103e3da5df8c913ad13c33 (patch) | |
| tree | 4c4687cc311bdef733cbcba23bc15ccdb1bba66b /.local/bin/scripts/transopen | |
| parent | c5446fd696c30537ef00b16577ced4df288852db (diff) | |
Added more flexible config for opening transmission client for different servers
Diffstat (limited to '.local/bin/scripts/transopen')
| -rwxr-xr-x | .local/bin/scripts/transopen | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/.local/bin/scripts/transopen b/.local/bin/scripts/transopen new file mode 100755 index 0000000..3897ef0 --- /dev/null +++ b/.local/bin/scripts/transopen @@ -0,0 +1,20 @@ +#!/bin/sh + +# Possible servers +hosts="raspberry +localhost" + +if [ -z "$1" ]; then + host=$(printf "$hosts" | fzf +m --reverse) +else + host="$1" +fi + +case $host in + localhost) tremc -c localhost ;; + raspberry) + host=$(pass Services/transmission/rpi-host) + creds=$(pass Services/transmission/rpi-creds) + tremc -c "$creds@$host" ;; +esac + |