mirror of
https://github.com/femtofox/femtofox.git
synced 2026-11-20 23:16:30 -05:00
commit
db6574790a
3 changed files with 23 additions and 1 deletions
|
|
@ -112,7 +112,7 @@ package_menu() {
|
|||
if [ $exit_status -eq 1 ]; then # Exit the loop if the user selects "Cancel" or closes the dialog
|
||||
return
|
||||
elif [ $exit_status -eq 2 ]; then # Help ("extra") button
|
||||
dialog --no-collapse --colors --title "$($package_dir/$1.sh -N) License" --msgbox "$($package_dir/$1.sh -G)" 0 0
|
||||
dialog --no-collapse --colors --title "$($package_dir/$1.sh -N) License" --msgbox " \Zu$($package_dir/$1.sh -N)\Zn\n$(if output=$($package_dir/$1.sh -T); [ -n "$output" ]; then echo "License: $output"; fi)\n\n$($package_dir/$1.sh -G)" 0 0
|
||||
else
|
||||
# execute the actual commands
|
||||
case $choice in
|
||||
|
|
|
|||
|
|
@ -70,7 +70,18 @@ license() {
|
|||
echo -e "Contents of $license:\n\n $([[ -f "$license" ]] && awk -v max=2000 -v file="$license" '{ len += length($0) + 1; if (len <= max) print; else if (!cut) { cut=1; printf "%s...\n\nFile truncated, see %s for complete license.", substr($0, 1, max - len + length($0)), file; exit } }' "$license")"
|
||||
}
|
||||
|
||||
## custom getopts example for this package
|
||||
# if [[ "$1" == "-k" ]]; then
|
||||
# generate_keys
|
||||
# fi
|
||||
|
||||
# parse arguments
|
||||
source /usr/local/bin/packages/femto_argument_parse.sh "$@"
|
||||
|
||||
# extra help example for this package
|
||||
# if [[ "$1" == "-h" ]]; then
|
||||
# echo -e "Additional argument for this package:\n\
|
||||
# -k Generate SSL keys. Must be first argument."
|
||||
# fi
|
||||
|
||||
exit 0
|
||||
|
|
@ -93,7 +93,18 @@ generate_keys() {
|
|||
fi
|
||||
}
|
||||
|
||||
# custom getopts for ttyd: generate key
|
||||
if [[ "$1" == "-k" ]]; then
|
||||
generate_keys
|
||||
fi
|
||||
|
||||
# parse arguments
|
||||
source /usr/local/bin/packages/femto_argument_parse.sh "$@"
|
||||
|
||||
# extra help for this package
|
||||
if [[ "$1" == "-h" ]]; then
|
||||
echo -e "Additional argument for this package:\n\
|
||||
-k Generate SSL keys. Must be first argument."
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue