35 lines
846 B
Plaintext
35 lines
846 B
Plaintext
|
#!/usr/bin/zsh
|
||
|
|
||
|
typeset -A srv
|
||
|
srv["trycaster"]="ssh -p 4999 chatlanin@92.53.65.239"
|
||
|
srv["dev_em"]="ssh a.zimin@dev01.emd01.lwb.d-net.pro"
|
||
|
srv["em_prod_1"]="ssh a.zimin@prod01.emp01.lwb.d-net.pro"
|
||
|
srv["em_prod_2"]="ssh a.zimin@prod02.emp01.lwb.d-net.pro"
|
||
|
|
||
|
source /mnt/raid/bin/scripts/system/style
|
||
|
|
||
|
typeset -A array
|
||
|
array["dir"]=dir
|
||
|
array["srv"]=srv
|
||
|
|
||
|
MODE_1=\"$1\"
|
||
|
INDEX=1
|
||
|
|
||
|
if [[ $MODE_1 == \"\" ]] then
|
||
|
echo ""
|
||
|
INDEX=1
|
||
|
OUTPUT="POS. # SERVER NAME # COMMAND\n----#--------------------------------#--------------------------------------------------------"
|
||
|
for key value in ${(kv)srv}; do
|
||
|
OUTPUT="$OUTPUT\n $INDEX # $BOLD$BLUE$key$RESET_COLOR # $ITALIC$CYAN$value$RESET_COLOR"
|
||
|
INDEX=$((INDEX + 1))
|
||
|
done
|
||
|
|
||
|
echo -ne $OUTPUT | column -ts $'#'
|
||
|
|
||
|
read MODE_1
|
||
|
MODE_1=\"$MODE_1\"
|
||
|
fi
|
||
|
|
||
|
cmd=${${(P)array["srv"]}[$MODE_1]}
|
||
|
bash -c $cmd
|