You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Update all scripts to upstream versions
- Add scripts/chce_tailscale.sh (missing in fork)
- Remove docs/ and lib/ (fork-only additions, present on add-scripts branch)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
# some bash magic: https://brianchildress.co/named-parameters-in-bash/
16
11
while [ $#-gt 0 ];do
17
12
if [[ $1==*"--"* ]];then
@@ -27,12 +22,12 @@ while [ $# -gt 0 ]; do
27
22
done
28
23
29
24
if [[ -n"$mikrus"&&-n"$possible_ssh_param" ]];then
30
-
msg_error "--mikrus and ssh-like argument ($possible_ssh_param) were given in the same time!"
25
+
echo"ERROR: --mikrus and ssh-like argument ($possible_ssh_param) were given in the same time!"
31
26
exit 1
32
27
fi
33
28
34
29
if [[ -n"$host"&&-n"$possible_ssh_param" ]];then
35
-
msg_error "--host and ssh-like argument ($possible_ssh_param) were given in the same time!"
30
+
echo"ERROR: --host and ssh-like argument ($possible_ssh_param) were given in the same time!"
36
31
exit 2
37
32
fi
38
33
@@ -41,13 +36,13 @@ user="${user:-root}"
41
36
42
37
if [ -n"$mikrus" ];then
43
38
if! [[ "$mikrus"=~ ^[a-z]+[0-9]+$ ]];then
44
-
msg_error "--mikrus parameter is not valid!"
39
+
echo"ERROR: --mikrus parameter is not valid!"
45
40
exit 3
46
41
fi
47
42
48
43
number_part=$(echo "$mikrus"| grep -o '[0-9]\+')
49
44
if [ -z"$number_part" ];then
50
-
msg_error "Could not extract number from mikrus name!"
45
+
echo"ERROR: Could not extract number from mikrus name!"
51
46
exit 4
52
47
fi
53
48
@@ -61,7 +56,7 @@ if [ -n "$possible_ssh_param" ]; then
61
56
fi
62
57
63
58
if [ -z"$host" ];then
64
-
msg_error "Host was not recognized by any known method (--mikrus or --host or by specifying user@host.com)."
59
+
echo"ERROR: Host was not recognized by any known method (--mikrus or --host or by specifying user@host.com)."
65
60
echo""
66
61
echo"Usage: you can pass following arguments:"
67
62
echo" --mikrus MIKRUS_NAME (i.e. 'X123')"
@@ -72,11 +67,11 @@ if [ -z "$host" ]; then
72
67
exit 5
73
68
fi
74
69
75
-
msg_info"Following params will be used to generate ssh config: user:'$user', host:'$host', port:'$port'"
70
+
echo"Following params will be used to generate ssh config: user:'$user', host:'$host', port:'$port'"
76
71
read -n 1 -s -p "Press enter (or space) to continue or any other key to cancel." decision
77
72
echo""
78
73
if [ -n"$decision" ];then
79
-
msg_info"No further changes."
74
+
echo"No further changes."
80
75
exit 0
81
76
fi
82
77
@@ -99,12 +94,12 @@ if ! grep -q "$header" ~/.ssh/config ; then
99
94
echo" Port $port">>~/.ssh/config
100
95
echo" IdentityFile $ssh_key_file">>~/.ssh/config
101
96
else
102
-
msg_error "'$header' already defined in ~/.ssh/config!"
97
+
echo"ERROR: '$header' already defined in ~/.ssh/config!"
103
98
exit 6
104
99
fi
105
100
106
101
ssh-copy-id -i "$ssh_key_file"$header
107
102
108
103
echo""
109
-
msg_ok"ssh was properly configured!"
110
-
msg_info"Remember, that you can use tab to use autofill to type connection string faster - type few first chars of Host (i.e. 'ssh ${header:0:8}', or even less), then press tab."
104
+
echo"ssh was properly configured!"
105
+
echo"Remember, that you can use tab to use autofill to type connection string faster - type few first chars of Host (i.e. 'ssh ${header:0:8}', or even less), then press tab."
0 commit comments