From ad1b9e920253a75ff076f3bcfdd284ea7fcee13b Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Tue, 3 Jun 2025 04:28:05 -0600 Subject: [PATCH] 1748946485 --- installer2.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/installer2.sh b/installer2.sh index a7b9da1..618d4ea 100644 --- a/installer2.sh +++ b/installer2.sh @@ -40,8 +40,12 @@ sudo apt update echo "Installing packages" sudo apt install telegraf grafana influxdb pps-tools gpsd gpsd-clients chrony syslog-ng -y +# check if /boot/firmware/config.txt is configured yet +grep -q -e "GPS PPS signals" /boot/firmware/config.txt +grepconfig=$? + # configure the overlay -if [ $(grep -q "GPS PPS signals" /boot/firmware/config.txt) -eq 0 ]; then +if [ $grepconfi -eq 0 ]; then echo "/boot/firmware/config.txt already updated, skipping" else echo "Adding lines to /boot/firmware/config.txt to enable pps and gpio uart" @@ -51,8 +55,12 @@ else sudo bash -c "echo 'init_uart_baud=115200' >> /boot/firmware/config.txt" # set baudrate here to fi +# check if pps-gpio is in /etc/modules already +grep -e "pps-gpio" /etc/modules +gerppps=$? + # add pps-gpio to modules -if [ $(grep -q "pps-gpios" /boot/firmware/config.txt) -eq 0 ]; then +if [ $gerppps -eq 0 ]; then echo "pps-gpio already in /etc/modules, skipping" else echo "Adding pps-gpio to modules"