Refinements to software menu

This commit is contained in:
nagumii 2025-01-11 23:02:48 +02:00
parent f2fade3071
commit 47556de85a
3 changed files with 9 additions and 17 deletions

View file

@ -72,7 +72,7 @@ $(echo "Currently: " && $package_dir/$1.sh -I && echo "\Zuinstalled\Zn" ||
$(if $package_dir/$1.sh -O | grep -q 'L'; then echo "Installs to: \Zu$($package_dir/$1.sh -L)\Zn"; fi)\n\
$(if $package_dir/$1.sh -O | grep -q 'C'; then echo "Conflicts with: \Zu$($package_dir/$1.sh -C)\Zn\n"; fi)\n\
An internet connection is required for installation.\n\
$(if $package_dir/$1.sh -O | grep -q 'U'; then echo "\nFor more information, visit $($package_dir/$1.sh -U)"; fi)" 0 0
$(if $package_dir/$1.sh -O | grep -q 'U'; then echo "\nFor more information, visit $($package_dir/$1.sh -U)"; fi)" 50 75
package_menu $1 # after user hits "OK", move on to package menu
}

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root. Try \`sudo femto-meshtasticd-config\`."
exit 1
@ -70,14 +70,9 @@ install() {
fi
chown -R femto $location #give ownership of installation directory to $user
git config --global --add safe.directory $location # prevents git error when updating
if ! grep -Fxq "alias curses" "/home/${SUDO_USER:-$(whoami)}/.bashrc"; then
echo "alias curses='python $location/main.py --host'" >> "/home/${SUDO_USER:-$(whoami)}/.bashrc"
echo "Shortcut \`curses\` added to .bashrc"
else
echo "Shortcut already exists in .bashrc"
fi
source /home/${SUDO_USER:-$(whoami)}/.bashrc
echo "Creating \`curses\` shortcut."
echo -e "#!/bin/bash\n$launch" | sudo tee /usr/local/bin/curses > /dev/null
chmod +x /usr/local/bin/curses
echo "user_message: To launch, run \`curses\`."
exit 0 # should be `exit 1` if the installation failed
}
@ -86,14 +81,11 @@ install() {
# uninstall script
uninstall() {
rm -rf $location
sed -i "/alias curses/d" "/home/${SUDO_USER:-$(whoami)}/.bashrc"
echo "Shortcut \`curses\` removed from .bashrc"
source /home/${SUDO_USER:-$(whoami)}/.bashrc
echo "user_message: All files removed shortcut \`curses\` removed."
rm /usr/local/bin/curses
echo "user_message: All files removed."
exit 0 # should be `exit 1` if the installation failed
}
#upgrade script
upgrade() {
cd $location

View file

@ -53,8 +53,8 @@ name="TC2-BBS" # software name
author="The Comms Channel" # software author - OPTIONAL
description="The TC²-BBS system integrates with Meshtastic devices. The system allows for message handling, bulletin boards, mail systems, and a channel directory." # software description - OPTIONAL (but strongly recommended!)
URL="https://github.com/TheCommsChannel/TC2-BBS-mesh" # software URL. Can contain multiple URLs - OPTIONAL
options="xiugedsrNADUOSLCIto" # script options in use by software package. For example, for a package with no service, exclude `edsr`
launch="" # command to launch software, if applicable
options="xiugedsrlNADUOSLCIto" # script options in use by software package. For example, for a package with no service, exclude `edsr`
launch="/opt/TC2-BBS-mesh/server.py" # command to launch software, if applicable
service_name="mesh-bbs" # 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="/opt/TC2-BBS-mesh" # install location REQUIRED if not apt installed. Generally, we use `/opt/software-name`
conflicts="Meshing Around, other \"full control\" packages" # comma delineated plain-text list of packages with which this package conflicts. Blank if none. Use the name as it appears in the $name field of the other package. Extra plaintext is allowed, such as "packageA, packageB, any other software that uses the Meshtastic CLI"