From 614138d1ece0e55823adf41e18f16a636ecbfef7 Mon Sep 17 00:00:00 2001 From: Andrey Zimin Date: Sun, 10 Mar 2024 14:05:49 +0300 Subject: [PATCH] fix scripts --- misc/bin/scripts/system/srv | 59 +++++++++++++++++++++++++++++++++++++ misc/bin/scripts/system/vpn | 9 +++++- 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/misc/bin/scripts/system/srv b/misc/bin/scripts/system/srv index 8c73fd1..85e58ef 100755 --- a/misc/bin/scripts/system/srv +++ b/misc/bin/scripts/system/srv @@ -1,5 +1,38 @@ #!/usr/bin/zsh +# typeset -A dir +# dir["wiki"]="/mnt/store/Store.Disk/Wiki" +# dir["st"]="/mnt/store" +# dir["sthome"]="/mnt/store/home" +# dir["sd"]="/mnt/store/Store.Disk" +# dir["app"]="/mnt/develop/application" +# dir["bin"]="/mnt/develop/bin" +# dir["cpp"]="/mnt/develop/projects/cpp" +# dir["golang"]="/mnt/develop/projects/golang" +# dir["pr"]="/mnt/develop/projects" +# dir["dev"]="/mnt/develop" +# dir["config"]="/home/chatlanin/.config" +# dir["docker"]="/mnt/develop/projects/docker" +# dir["gitea"]="/mnt/develop/projects/golang/gitea" +# dir["sandbox"]="/mnt/develop/projects/cpp/sandbox" +# dir["server"]="/mnt/develop/projects/server" +# dir["actorfm"]="/mnt/develop/projects/cpp/actorfm" +# dir["actorfm.asio"]="/mnt/develop/projects/cpp/actorfm.asio" +# dir["dwm"]="/mnt/develop/application/dwm/dwm.6.2" +# dir["base"]="/mnt/develop/projects/cpp/base" +# dir["hack"]="/mnt/develop/projects/cpp/hack" +# dir["rrr"]="/mnt/develop/projects/cpp/rrr" +# dir["rendert"]="/mnt/develop/projects/cpp/rendert" +# dir["trycaster"]="/mnt/develop/projects/cpp/trycaster" +# dir["trycaster.web"]="/mnt/develop/projects/cpp/trycaster/trycaster.web" +# dir["league.dance"]="/mnt/develop/projects/cpp/league.dance/v2.0" +# dir["goto"]="/mnt/develop/projects/cpp/goto" +# dir["auth.base"]="/mnt/develop/projects/cpp/auth.base" +# dir["fonmix"]="/mnt/develop/projects/cpp/fonmix" +# dir["chatlanin.com.ru"]="/mnt/develop/projects/cpp/chatlanin.com.ru" +# dir["task_book"]="/mnt/develop/projects/cpp/task_book" +# dir["lua"]="/mnt/develop/projects/lua" + 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" @@ -13,10 +46,22 @@ array["dir"]=dir array["srv"]=srv MODE_1=\"$1\" +# MODE_2=\"$2\" INDEX=1 if [[ $MODE_1 == \"\" ]] then + # echo "" + # OUTPUT="POS. # DIR'S # COMMAND\n----#--------------------------------#--------------------------------------------------------" + # + # for key value in ${(kv)dir}; do + # OUTPUT="$OUTPUT\n $INDEX # $BOLD$BLUE$key$RESET_COLOR # $ITALIC$CYAN$value$RESET_COLOR" + # INDEX=$((INDEX + 1)) + # done + # + # echo -ne $OUTPUT | column -ts $'#' + echo "" + INDEX=1 OUTPUT="POS. # SERVER NAME # COMMAND\n----#--------------------------------#--------------------------------------------------------" for key value in ${(kv)srv}; do @@ -26,9 +71,23 @@ if [[ $MODE_1 == \"\" ]] then echo -ne $OUTPUT | column -ts $'#' + # read MODE_1 MODE_2 read MODE_1 MODE_1=\"$MODE_1\" + # MODE_2=\"$MODE_2\" fi +# case $MODE_1 in +# \"dir\") +# cmd=${${(P)array[$MODE_1]}[$MODE_2]} +# cd $cmd +# ;; +# \"srv\") +# cmd=${${(P)array[$MODE_1]}[$MODE_2]} +# bash -c $cmd +# ;; +# esac + cmd=${${(P)array["srv"]}[$MODE_1]} bash -c $cmd + diff --git a/misc/bin/scripts/system/vpn b/misc/bin/scripts/system/vpn index f37957a..1792b76 100755 --- a/misc/bin/scripts/system/vpn +++ b/misc/bin/scripts/system/vpn @@ -1,3 +1,10 @@ #!/bin/zsh -sudo openvpn /home/$USER/openvpn.conf +var_user="a.zimin" +var_pass="!1979Rekmnbdfnjh2021" + +source "$HOME/bin/scripts/system/style" +echo -ne $BOLD$GREEN"user:$RESET_COLOR $var_user" +echo -ne $BOLD$GREEN"pass:$RESET_COLOR $var_pass" + +sudo openvpn /home/chatlanin/openvpn.conf