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 new file mode 100755 index 0000000..d201816 --- /dev/null +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/packages/curses_client.sh @@ -0,0 +1,169 @@ + #!/bin/bash +if [[ $EUID -ne 0 ]]; then + echo "This script must be run as root. Try \`sudo femto-meshtasticd-config\`." + exit 1 +fi + +args="$@" # arguments to this script +interaction="true" +help=$(cat <> "/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 "user_message: To launch, run \`curses\`." + exit 0 # should be `exit 1` if the installation failed +} + + +# 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." + exit 0 # should be `exit 1` if the installation failed +} + + +#upgrade script +upgrade() { + cd $location + if ! git pull; then + echo "user_message: Git pull failed. Is internet connected?" + exit 1 + fi + exit 0 +} + + +# Check if already installed. `exit 0` if yes, `exit 1` if no +check() { + #the following works for cloned repos, but not for apt installs + if [ -d "$location" ]; then + #echo "Already installed" + exit 0 + else + #echo "Not installed" + exit 1 + fi +} + +while getopts ":h$options" opt; do + case ${opt} in + h) # Option -h (help) + echo -e "$help" + ;; + x) # Option -x (no user interaction available) + interaction="false" + ;; + i) # Option -i (install) + install + ;; + u) # Option -u (uninstall) + uninstall + ;; + g) # Option -g (upgrade) + upgrade + ;; + e) # Option -e (Enable service, if applicable) + systemctl enable $service_name + ;; + d) # Option -d (Disable service, if applicable) + systemctl disable $service_name + ;; + s) # Option -s (Stop service) + systemctl stop $service_name + ;; + r) # Option -r (Start/Restart) + systemctl restart $service_name + ;; + l) # Option -l (Run software) + echo "Launching $name..." + sudo -u ${SUDO_USER:-$(whoami)} $launch + ;; + N) echo -e $name ;; + A) echo -e $author ;; + D) echo $description ;; + U) echo -e $URL ;; + O) echo -e $options ;; + S) # Option -S (Get service status) + systemctl status $service_name + ;; + L) echo -e $location ;; + C) echo -e $conflicts ;; + I) # Option -I (Check if already installed) + check + ;; + esac +done + +exit 0 \ No newline at end of file diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/packages/meshing_around.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/packages/meshing_around.sh index 44cb9ff..efb637c 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/packages/meshing_around.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/packages/meshing_around.sh @@ -7,8 +7,10 @@ fi args="$@" help=$(cat <