mirror of
https://github.com/DictXiong/dotfiles.git
synced 2024-11-24 14:07:01 +08:00
riot: support extra options and extra -o options
This commit is contained in:
parent
76af9fa434
commit
2fa248fdb0
12
scripts/riot
12
scripts/riot
|
@ -5,6 +5,7 @@ source "$THIS_DIR/../tools/common.sh"
|
|||
RIOT_TRUST_CLIENT=${RIOT_TRUST_CLIENT:-${DFS_TRUST:-0}}
|
||||
RIOT_TRUST_SERVER=${RIOT_TRUST_SERVER:-0}
|
||||
RIOT_CONFIG_DIR="$THIS_DIR/riot.d"
|
||||
RIOT_EXTRA_OPTIONS=""
|
||||
|
||||
# check if port number valid
|
||||
check_port() {
|
||||
|
@ -124,7 +125,7 @@ prepare_ssh_cmd() {
|
|||
else
|
||||
local port_param='-p'
|
||||
fi
|
||||
echo "$ssh_bin ${PORT:+$port_param} $PORT $SSH_OPTIONS $SCP_SRC $USERNAME${USERNAME:+@}$SERVER $SCP_DST ${@:2}"
|
||||
echo "$ssh_bin ${PORT:+$port_param} $PORT $SSH_OPTIONS $RIOT_EXTRA_OPTIONS $SCP_SRC $USERNAME${USERNAME:+@}$SERVER $SCP_DST ${@:2}"
|
||||
}
|
||||
|
||||
# ssh
|
||||
|
@ -188,6 +189,15 @@ router() {
|
|||
exit
|
||||
fi
|
||||
|
||||
while [[ "$1" == -* ]]; do
|
||||
RIOT_EXTRA_OPTIONS="$RIOT_EXTRA_OPTIONS $1"
|
||||
if [[ "$1" == "-o" ]]; then
|
||||
RIOT_EXTRA_OPTIONS="$RIOT_EXTRA_OPTIONS $2"
|
||||
shift
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
IFS=',' read -ra remotes <<< "$1"
|
||||
for remote in "${remotes[@]}"; do
|
||||
if [[ -z "$remote" ]]; then
|
||||
|
|
Loading…
Reference in New Issue
Block a user