1
0
mirror of https://github.com/AG7GN/nexus-utilities.git synced 2025-05-21 08:50:13 -07:00

Added 'none' as an autostart piano script option.

This commit is contained in:
Steve Magnuson 2020-05-25 14:53:15 -07:00
parent 8b90db1bce
commit d2620d69da
3 changed files with 12 additions and 10 deletions

View File

@ -131,8 +131,7 @@ Print Direwolf's audio statistics every x seconds. Set to 0 to disable printing
<h2 id="auto">Autostart APRS</h2> <h2 id="auto">Autostart APRS</h2>
<p> <p>
<a href="#top">Top</a> <a href="#top">Top</a>
Default is disabled. If disabled, Direwolf APRS will not autostart when the Pi boots up. Otherwise, select which levers in the piano switch you want to be in the ON position. A corresponding piano script will be created and, if the switches are in the selected postion, will autostart APRS at bootup. Default is disabled. If disabled, Direwolf APRS will not autostart when the Pi boots up. Otherwise, select which levers in the piano switch you want to be in the ON (down) position. A corresponding piano script will be created and, if the switches are in the selected postion, will autostart APRS at bootup. If 'none' is selected, meaning all switches are in the OFF (UP) position, script piano.sh will be created and will autostart APRS provided all levers are in the UP position. See <a href="https://github.com/AG7GN/hampi-utilities/blob/master/README.md#check-piano-script">Check Piano Script</a> for details.
See <a href="https://github.com/AG7GN/hampi-utilities/blob/master/README.md#check-piano-script">Check Piano Script</a> for details.
</p> </p>
<a href="#top">Top</a> <a href="#top">Top</a>

View File

@ -16,7 +16,7 @@
#% #%
#================================================================ #================================================================
#- IMPLEMENTATION #- IMPLEMENTATION
#- version ${SCRIPT_NAME} 0.1.2 #- version ${SCRIPT_NAME} 0.1.3
#- author Steve Magnuson, AG7GN #- author Steve Magnuson, AG7GN
#- license CC-BY-SA Creative Commons License #- license CC-BY-SA Creative Commons License
#- script_id 0 #- script_id 0
@ -218,8 +218,8 @@ function loadSettings () {
;; ;;
esac esac
BOOTSTARTs="disabled~1~12~13~14~123~124~134~1234~2~23~234~24~3~34~4" BOOTSTARTs="disabled~none~1~12~13~14~123~124~134~1234~2~23~234~24~3~34~4"
[[ $BOOTSTARTs =~ ${F[_BOOTSTART_]} && ${F[_BOOTSTART_]} =~ ^[1-4]{1,4}$ ]] && BOOTSTARTs="$(echo "$BOOTSTARTs" | sed "s/~${F[_BOOTSTART_]}/~\^${F[_BOOTSTART_]}/1")" || BOOTSTARTs="^$BOOTSTARTs" [[ $BOOTSTARTs =~ ${F[_BOOTSTART_]} && ${F[_BOOTSTART_]} =~ ^(none|[1-4]{1,4})$ ]] && BOOTSTARTs="$(echo "$BOOTSTARTs" | sed "s/~${F[_BOOTSTART_]}/~\^${F[_BOOTSTART_]}/1")" || BOOTSTARTs="^$BOOTSTARTs"
case ${F[_APRSMODE_]} in case ${F[_APRSMODE_]} in
Digi*) # Digipeater or Digipeater + iGate Digi*) # Digipeater or Digipeater + iGate
@ -615,13 +615,16 @@ do
# Make or update an autostart piano switch script if necessary # Make or update an autostart piano switch script if necessary
if [[ ${F[_BOOTSTART_]} == "disabled" ]] if [[ ${F[_BOOTSTART_]} == "disabled" ]]
then # Disable autostart then # Disable autostart
rm -f $HOME/piano$PREVIOUS_AUTOSTART.sh [[ $PREVIOUS_AUTOSTART =~ none ]] && SWITCHES="" || SWITCHES="$PREVIOUS_AUTOSTART"
rm -f $HOME/piano${SWITCHES}.sh
else # Enable autostart else # Enable autostart
if [[ ${F[_BOOTSTART_]} != $PREVIOUS_AUTOSTART ]] if [[ ${F[_BOOTSTART_]} != $PREVIOUS_AUTOSTART ]]
then # Previous autostart was not the same as the requested autostart then # Previous autostart was not the same as the requested autostart
rm -f $HOME/piano$PREVIOUS_AUTOSTART.sh [[ $PREVIOUS_AUTOSTART =~ none ]] && SWITCHES="" || SWITCHES="$PREVIOUS_AUTOSTART"
echo -e "#!/bin/bash\n$(command -v $(basename $0)) >/dev/null 2>&1" > $HOME/piano${F[_BOOTSTART_]}.sh rm -f $HOME/piano${SWITCHES}.sh
chmod +x $HOME/piano${F[_BOOTSTART_]}.sh [[ ${F[_BOOTSTART_]} =~ none ]] && SWITCHES="" || SWITCHES="${F[_BOOTSTART_]}"
echo -e "#!/bin/bash\n$(command -v $(basename $0)) >/dev/null 2>&1" > $HOME/piano${SWITCHES}.sh
chmod +x $HOME/piano$SWITCHES.sh
fi fi
fi fi
;; ;;

View File

@ -1 +1 @@
VERSION="2.1.27" VERSION="2.2.0"