From 47556de85add4b040641da50e5a991266f4cf01b Mon Sep 17 00:00:00 2001 From: nagumii Date: Sat, 11 Jan 2025 23:02:48 +0200 Subject: [PATCH] Refinements to software menu --- .../usr/local/bin/femto-software.sh | 2 +- .../usr/local/bin/packages/curses_client.sh | 20 ++++++------------- .../usr/local/bin/packages/tc2_bbs.sh | 4 ++-- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-software.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-software.sh index 69490e5..eecf9f7 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-software.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-software.sh @@ -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 } diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/packages/curses_client.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/packages/curses_client.sh index dbfaafb..55ca739 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/packages/curses_client.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/packages/curses_client.sh @@ -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 diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/packages/tc2_bbs.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/packages/tc2_bbs.sh index 531c293..4df601d 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/packages/tc2_bbs.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/packages/tc2_bbs.sh @@ -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"