Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
367128ffab | |||
921efeb8d2 |
8
s3h.sh
8
s3h.sh
@ -3,7 +3,7 @@
|
|||||||
# config
|
# config
|
||||||
DIALOG=dialog #gdialog kdialog
|
DIALOG=dialog #gdialog kdialog
|
||||||
START_DIR="$HOME/.s3h"
|
START_DIR="$HOME/.s3h"
|
||||||
VERSION="1.7"
|
VERSION="1.8"
|
||||||
|
|
||||||
# TODO: use opt parsing
|
# TODO: use opt parsing
|
||||||
if [[ $# -eq 1 && "$1" == "-v" ]]; then
|
if [[ $# -eq 1 && "$1" == "-v" ]]; then
|
||||||
@ -45,6 +45,10 @@ while [[ -z "$configFile" ]]; do
|
|||||||
dir="$START_DIR"
|
dir="$START_DIR"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# relative path to START_DIR
|
||||||
|
# XXX: can be done in bash itself?
|
||||||
|
relPath=$(echo ${dir} |sed "s;^${START_DIR};;g")
|
||||||
|
|
||||||
# add parent selector if not already in $START_DIR
|
# add parent selector if not already in $START_DIR
|
||||||
if [[ "$START_DIR" == "$dir" ]]; then
|
if [[ "$START_DIR" == "$dir" ]]; then
|
||||||
para=()
|
para=()
|
||||||
@ -82,7 +86,7 @@ while [[ -z "$configFile" ]]; do
|
|||||||
if [[ ! -z "$preselect" ]]; then
|
if [[ ! -z "$preselect" ]]; then
|
||||||
dialogOptions="$dialogOptions --default-item $preselect"
|
dialogOptions="$dialogOptions --default-item $preselect"
|
||||||
fi
|
fi
|
||||||
ret=$("$DIALOG" --no-tags --stdout $dialogOptions --menu "select connection" 0 0 0 ${para[@]} 2>&1)
|
ret=$("$DIALOG" --title "${relPath}" --no-tags --stdout $dialogOptions --menu "select connection" 0 0 0 ${para[@]} 2>&1)
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
clear
|
clear
|
||||||
exit 1
|
exit 1
|
||||||
|
Reference in New Issue
Block a user