group specific options
.options file can be added into group folder to add ssh options for every file inside this group folder
This commit is contained in:
parent
04215f8320
commit
dad2a0a902
16
s3h.sh
16
s3h.sh
@ -24,11 +24,13 @@ while [[ -z "$configFile" ]]; do
|
||||
fi
|
||||
|
||||
# add directory selectors
|
||||
for d in `find $dir -mindepth 1 -maxdepth 1 -type d -printf "%f\n" |sort`; do
|
||||
dirs=`find $dir -mindepth 1 -maxdepth 1 ! -name '.*' -type d -printf "%f\n" |sort`
|
||||
for d in $dirs; do
|
||||
para+=("$d" "<$d>")
|
||||
done
|
||||
# add file selectors
|
||||
for d in `find $dir -mindepth 1 -maxdepth 1 -type f -printf "%f\n" |sort`; do
|
||||
files=`find $dir -mindepth 1 -maxdepth 1 ! -name '.*' -type f -printf "%f\n" |sort`
|
||||
for d in $files; do
|
||||
para+=("$d" "$d")
|
||||
done
|
||||
|
||||
@ -53,14 +55,22 @@ done
|
||||
|
||||
# read config file and connect
|
||||
if [[ -f "$configFile" ]]; then
|
||||
clear
|
||||
# each line equals one config option
|
||||
para=()
|
||||
while read -r configLine; do
|
||||
para+=($configLine)
|
||||
done < "$configFile"
|
||||
|
||||
# lookup group specific option file
|
||||
if [[ -f "$dir/.options" ]]; then
|
||||
while read -r configLine; do
|
||||
para+=($configLine)
|
||||
done < "$dir/.options"
|
||||
echo "using group options file '$dir/.options'"
|
||||
fi
|
||||
|
||||
# clear screen // remove dialog colors
|
||||
clear
|
||||
echo "config file '$configFile' selected. connecting..."
|
||||
|
||||
# execute ssh
|
||||
|
Loading…
x
Reference in New Issue
Block a user