More copyparty tweaks.
This commit is contained in:
@@ -148,7 +148,7 @@ choose_copyparty_user() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
selectedUser="$(menulist "${userEntries[@]}")" || return 1
|
selectedUser="$(menulist --prompt "Please select the user Copyparty should be run as." "${userEntries[@]}")" || return 1
|
||||||
printf '%s\n' "$selectedUser"
|
printf '%s\n' "$selectedUser"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-1
@@ -37,9 +37,15 @@ yesno() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
menulist() {
|
menulist() {
|
||||||
|
local promptText="Please select an option"
|
||||||
local menuList=()
|
local menuList=()
|
||||||
local menuItem=""
|
local menuItem=""
|
||||||
|
|
||||||
|
if [[ "$1" == --prompt ]]; then
|
||||||
|
promptText="$2"
|
||||||
|
shift 2
|
||||||
|
fi
|
||||||
|
|
||||||
for menuItem in "$@"; do
|
for menuItem in "$@"; do
|
||||||
menuList+=("$menuItem" "$menuItem")
|
menuList+=("$menuItem" "$menuItem")
|
||||||
done
|
done
|
||||||
@@ -47,7 +53,7 @@ menulist() {
|
|||||||
dialog --backtitle "Configure Server" \
|
dialog --backtitle "Configure Server" \
|
||||||
--clear \
|
--clear \
|
||||||
--no-tags \
|
--no-tags \
|
||||||
--menu "Please select an option" 0 0 0 "${menuList[@]}" --stdout
|
--menu "$promptText" 0 0 0 "${menuList[@]}" --stdout
|
||||||
}
|
}
|
||||||
|
|
||||||
textbox() {
|
textbox() {
|
||||||
|
|||||||
Regular → Executable
Reference in New Issue
Block a user