You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
dotfiles/scripts/sshto/core/contents_menu.inc

26 lines
800 B

new_list() {
list=()
match=""
for item in "${fullist[@]}"; {
case $item:$match in
-*\ *\ *-:1) break;;
-*\ $filter\ *-:*) match=1;;
esac
[[ $match ]] && list+=( "$item" )
}
[[ ${list[*]} ]] && echo "filter='$filter'" > "$tmpfile" || { list=( "${fullist[@]}" ); rm "$tmpfile"; }
}
editconfig() { edit_configs; update_hosts; }
contents_menu () {
filter=$(dialog --output-fd 1 --ok-label "SELECT" --cancel-label "BACK" \
--extra-button --extra-label "Edit" \
--no-items --menu "Select list of hosts:" 0 0 0 "All" "${content[@]}")
case $filter:$? in
All:0) list=( "${fullist[@]}" );;
*:0) new_list;;
*:3) editconfig;;
esac
main_dialog
}