Compare commits
2 Commits
014e51fa0e
...
66d994c71d
Author | SHA1 | Date | |
---|---|---|---|
66d994c71d | |||
e33cfe8c9d |
12
s3h.sh
12
s3h.sh
@ -107,7 +107,9 @@ done
|
||||
|
||||
# read config file and connect
|
||||
if [[ -f "$configFile" ]]; then
|
||||
# clear screen // remove dialog colors
|
||||
clear
|
||||
|
||||
# each line equals one config option
|
||||
para=()
|
||||
while read -r configLine; do
|
||||
@ -122,19 +124,23 @@ if [[ -f "$configFile" ]]; then
|
||||
echo "using group options file '$dir/.options'"
|
||||
fi
|
||||
|
||||
# clear screen // remove dialog colors
|
||||
echo "config file '$configFile' selected. connecting..."
|
||||
|
||||
# save selected configFile for next call of s3h
|
||||
echo "$configFile" > "$LAST"
|
||||
|
||||
# extract user@host if ~ in config file name
|
||||
echo "config file '$configFile' selected. connecting..."
|
||||
login=$(basename "$configFile")
|
||||
if [[ "$login" == *"~"* ]]; then
|
||||
login="${login#*~}"
|
||||
fi
|
||||
|
||||
# set console title
|
||||
echo -ne "\033]30;$login\007"
|
||||
|
||||
# execute ssh
|
||||
echo "Running 'ssh ${para[@]} $login'"
|
||||
ssh ${para[@]} "$login"
|
||||
|
||||
# reset console title to something usefull
|
||||
echo -ne "\033]30;$USER@${HOSTNAME%%.*}\007"
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user