mirror of
https://github.com/femtofox/femtofox.git
synced 2026-11-25 17:36:29 -05:00
commit
cb92aa7b18
2 changed files with 8 additions and 4 deletions
|
|
@ -57,6 +57,10 @@
|
|||
#meshtastic_admin_key="XX="
|
||||
#meshtastic_legacy_admin="false"
|
||||
|
||||
## Meshtastic i2c state.
|
||||
## Enabling i2c without devices connected will lead to slowdowns and error messages.
|
||||
## Options are "enable" and "disable"
|
||||
meshtastic_i2c="disable"
|
||||
|
||||
### If the following line is uncommented, USB config will be skipped if a log file is present on the USB drive, indicating the tool has already been run on this system
|
||||
#dont_run_if_log_exists
|
||||
|
|
|
|||
|
|
@ -433,7 +433,7 @@ meshtastic_settings() {
|
|||
4 "Security settings" "" \
|
||||
5 "Mesh connectivity test" "" \
|
||||
6 "Manage Meshtasticd service" "" \
|
||||
7 "Enable/disable i2c devices" "" \
|
||||
7 "Enable/disable i2c support" "" \
|
||||
8 "Upgrade/install Meshtasticd" "" \
|
||||
9 "Uninstall Meshtasticd" "" \
|
||||
" " "" "" \
|
||||
|
|
@ -598,7 +598,7 @@ meshtastic_settings() {
|
|||
choice="" # zero the choice before loading the submenu
|
||||
while true; do
|
||||
i2c_state=$(femto-utils.sh -R "$(femto-meshtasticd-config.sh -I check)")
|
||||
choice=$(dialog --no-collapse --colors --cancel-label "Back" --title "Meshtastic i2c" --default-item "$choice" --menu "i2c is used for sensors and displays.\nCurrently \Zu$i2c_state." 12 42 5 \
|
||||
choice=$(dialog --no-collapse --colors --cancel-label "Back" --title "Meshtastic i2c Support" --default-item "$choice" --menu "i2c is used for sensors and displays.\nCurrently \Zu$i2c_state." 12 42 5 \
|
||||
$(if echo "$i2c_state" | grep -q 'disabled'; then echo "Enable i2c x"; fi) \
|
||||
$(if echo "$i2c_state" | grep -q 'enabled'; then echo "Disable i2c x"; fi) \
|
||||
" " "" \
|
||||
|
|
@ -606,13 +606,13 @@ meshtastic_settings() {
|
|||
[ $? -eq 1 ] && break # Exit the loop if the user selects "Cancel" or closes the dialog
|
||||
case $choice in
|
||||
"Enable i2c")
|
||||
dialog --no-collapse --colors --title "$title" --yesno "Enable i2c?\n\nEnabling i2c without devices connected will lead to slowdowns and error messages." 9 47
|
||||
dialog --no-collapse --colors --title "Meshtastic i2c Support" --yesno "Enable i2c?\n\nEnabling i2c without devices connected will lead to slowdowns and error messages." 9 47
|
||||
if [ $? -eq 0 ]; then #unless cancel/no
|
||||
femto-meshtasticd-config.sh -I enable
|
||||
fi
|
||||
;;
|
||||
"Disable i2c")
|
||||
dialog --no-collapse --colors --title "$title" --yesno "Disable i2c?\n\nDisabling i2c will only apply to Meshtastic, not to Foxbuntu." 9 50
|
||||
dialog --no-collapse --colors --title "Meshtastic i2c Support" --yesno "Disable i2c?\n\nDisabling i2c will only apply to Meshtastic, not to Foxbuntu." 9 50
|
||||
if [ $? -eq 0 ]; then #unless cancel/no
|
||||
femto-meshtasticd-config.sh -I disable
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue