mirror of
https://github.com/femtofox/femtofox.git
synced 2026-11-20 15:06:36 -05:00
add install location variable
This commit is contained in:
parent
154561fe85
commit
6714a79eb5
3 changed files with 22 additions and 9 deletions
|
|
@ -5,7 +5,7 @@ export LANG=C.UTF-8
|
|||
|
||||
# build and display package intro, then load package menu
|
||||
package_intro() {
|
||||
dialog --title "$software" --msgbox "\
|
||||
dialog --title "Software Manager" --msgbox "\
|
||||
$(/usr/local/bin/software/$1.sh -N)\n\
|
||||
$(if /usr/local/bin/software/$1.sh -O | grep -q 'A'; then echo -e "by $(/usr/local/bin/software/$1.sh -A)"; fi)\n\
|
||||
\n\
|
||||
|
|
@ -29,7 +29,7 @@ package_menu() {
|
|||
$(if /usr/local/bin/software/$1.sh -O | grep -q 's'; then echo "Stop service x"; fi) \
|
||||
$(if /usr/local/bin/software/$1.sh -O | grep -q 'r'; then echo "Start/restart service x"; fi) \
|
||||
"" "" \
|
||||
"Exit" "" 3>&1 1>&2 2>&3)
|
||||
"Back" "" 3>&1 1>&2 2>&3)
|
||||
|
||||
exit_status=$? # This line checks the exit status of the dialog command
|
||||
|
||||
|
|
@ -45,14 +45,14 @@ package_menu() {
|
|||
"Disable service") eval "/usr/local/bin/software/$1.sh -d" ;;
|
||||
"Stop service") eval "/usr/local/bin/software/$1.sh -s" ;;
|
||||
"Start/restart service") eval "/usr/local/bin/software/$1.sh -r" ;;
|
||||
"Back") break ;;
|
||||
"Back to software manager") break ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
while true; do
|
||||
title="Software"
|
||||
title="Software Manager"
|
||||
option=""
|
||||
option=$(dialog --cancel-label "Back" --menu "$title" 0 0 6 \
|
||||
1 "Meshing Around by Spud" \
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@ fi
|
|||
|
||||
args="$@"
|
||||
help=$(cat <<EOF
|
||||
Options are:
|
||||
Arguments:
|
||||
Actions:
|
||||
-h This message
|
||||
-i Install
|
||||
-u Uninstall
|
||||
|
|
@ -15,12 +16,14 @@ Options are:
|
|||
-d Disable service, if applicable
|
||||
-s Stop service
|
||||
-r Start/Restart
|
||||
Information:
|
||||
-N Get name
|
||||
-A Get author
|
||||
-D Get description
|
||||
-U Get URL
|
||||
-O Get options supported by this script
|
||||
-S Get service status
|
||||
-L Install location
|
||||
EOF
|
||||
)
|
||||
|
||||
|
|
@ -36,6 +39,7 @@ description="Meshing Around is a feature-rich bot designed to enhance your Mesht
|
|||
URL="https://github.com/SpudGunMan/meshing-around" # software URL OPTIONAL. Can contain multiple URLs
|
||||
options="iugedsrNADUOS" # script options in use by software package. For example, for a package with no service, exclude `edsr`
|
||||
service_name="mesh_bot pong_bot" # the name of the service, such as `chrony`. REQUIRED if service options are in use. If multiple services, separate by spaces "service1 service2"
|
||||
location="" # install location
|
||||
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
|
|
@ -150,6 +154,7 @@ while getopts ":h$options" opt; do
|
|||
S) # Option -S (Get service status)
|
||||
systemctl status $service_name
|
||||
;;
|
||||
L) echo -e $location ;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
|
|
|||
|
|
@ -4,9 +4,10 @@ if [[ $EUID -ne 0 ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
args="$@"
|
||||
args="$@" # arguments to this script
|
||||
help=$(cat <<EOF
|
||||
Options are:
|
||||
Arguments:
|
||||
Actions:
|
||||
-h This message
|
||||
-i Install
|
||||
-u Uninstall
|
||||
|
|
@ -15,12 +16,14 @@ Options are:
|
|||
-d Disable service, if applicable
|
||||
-s Stop service
|
||||
-r Start/Restart
|
||||
Information:
|
||||
-N Get name
|
||||
-A Get author
|
||||
-D Get description
|
||||
-U Get URL
|
||||
-O Get options supported by this script
|
||||
-S Get service status
|
||||
-L Install location
|
||||
EOF
|
||||
)
|
||||
|
||||
|
|
@ -34,8 +37,9 @@ name="" # software name
|
|||
author="" # software author OPTIONAL
|
||||
description="" # software description OPTIONAL (but strongly recommended!)
|
||||
URL="" # software URL OPTIONAL. Can contain multiple URLs
|
||||
options="iugedsrNADUOS" # script options in use by software package. For example, for a package with no service, exclude `edsr`
|
||||
service_name="" # the name of the service, such as `chrony`. REQUIRED if service options are in use. If multiple services, separate by spaces "service1 service2"
|
||||
options="iugedsrNADUOSL" # script options in use by software package. For example, for a package with no service, exclude `edsr`
|
||||
service_name="" # the name of the service/s, such as `chrony`. REQUIRED if service options are in use. If multiple services, separate by spaces "service1 service2"
|
||||
location="" # install location
|
||||
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
|
|
@ -45,16 +49,19 @@ if [ $# -eq 0 ]; then
|
|||
fi
|
||||
|
||||
|
||||
# install script
|
||||
install() {
|
||||
echo placeholder
|
||||
}
|
||||
|
||||
|
||||
# uninstall script
|
||||
uninstall() {
|
||||
echo placeholder
|
||||
}
|
||||
|
||||
|
||||
#upgrade script
|
||||
upgrade() {
|
||||
echo placeholder
|
||||
}
|
||||
|
|
@ -94,6 +101,7 @@ while getopts ":h$options" opt; do
|
|||
S) # Option -S (Get service status)
|
||||
systemctl status $service_name
|
||||
;;
|
||||
L) echo -e $location ;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue