From 8ba460683df91c700488b93fe9c7a0ce594dff37 Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Tue, 3 Jun 2025 06:10:46 -0600 Subject: [PATCH] 1748952647 --- installer0.sh | 10 ------- installer1.sh | 15 ++++------ installer2.sh | 62 ++++----------------------------------- installer3.sh | 80 ++++++++++++++++++++++++++++++++++++--------------- installer4.sh | 33 +++++++++++++++++++++ 5 files changed, 100 insertions(+), 100 deletions(-) delete mode 100644 installer0.sh create mode 100644 installer4.sh diff --git a/installer0.sh b/installer0.sh deleted file mode 100644 index 5309a1c..0000000 --- a/installer0.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# updoot this -echo "Updating this repo" -git pull - -# run da raspberry pi config script -sudo raspi-config - -echo "Rebooting in 5 minutes" -sudo shutdown -r +5 \ No newline at end of file diff --git a/installer1.sh b/installer1.sh index 7aed6f1..5309a1c 100644 --- a/installer1.sh +++ b/installer1.sh @@ -1,15 +1,10 @@ #!/bin/bash -set -e +# updoot this +echo "Updating this repo" +git pull -# updoot -echo "Updating software lists" -sudo apt update - -echo "Fully upgrading" -sudo apt dist-upgrade -y - -echo "Cleaning up" -sudo apt autoremove +# run da raspberry pi config script +sudo raspi-config echo "Rebooting in 5 minutes" sudo shutdown -r +5 \ No newline at end of file diff --git a/installer2.sh b/installer2.sh index ca882a5..7aed6f1 100644 --- a/installer2.sh +++ b/installer2.sh @@ -1,67 +1,15 @@ #!/bin/bash set -e -# grafana repo and install -echo "Add Grafana repo" -sudo mkdir -p /etc/apt/keyrings/ -wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/null -echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee /etc/apt/sources.list.d/grafana.list - -# telegraf repo and install -echo "Add Telegraf repo" -curl --silent --location -O \ -https://repos.influxdata.com/influxdata-archive.key \ -&& echo "943666881a1b8d9b849b74caebf02d3465d6beb716510d86a39f6c8e8dac7515 influxdata-archive.key" \ -| sha256sum -c - && cat influxdata-archive.key \ -| gpg --dearmor \ -| sudo tee /etc/apt/trusted.gpg.d/influxdata-archive.gpg > /dev/null \ -&& echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive.gpg] https://repos.influxdata.com/debian stable main' \ -| sudo tee /etc/apt/sources.list.d/influxdata.list - -# remove dat key file thing -if [ -f ./influxdata-archive.key ]; then - echo "Removing ./influxdata-archive.key" - rm -f ./influxdata-archive.key -else - echo "./influxdata-archive.key not found, skipping delete" -fi - -# install em -echo "Getting new software lists" +# updoot +echo "Updating software lists" sudo apt update -echo "Installing packages" -sudo apt install telegraf grafana influxdb pps-tools gpsd gpsd-clients chrony syslog-ng gh lynx btop htop iptraf iotop neovim -y 2>/dev/null - -# check if /boot/firmware/config.txt is configured yet -grep -q -e "GPS PPS signals" /boot/firmware/config.txt -grepconfig=$? - -# configure the overlay -if [ $grepconfig -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" - sudo bash -c "echo '# the next 3 lines are for GPS PPS signals' >> /boot/firmware/config.txt" - sudo bash -c "echo 'dtoverlay=pps-gpio,gpiopin=18' >> /boot/firmware/config.txt" - sudo bash -c "echo 'enable_uart=1' >> /boot/firmware/config.txt" - 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 [ $gerppps -eq 0 ]; then - echo "pps-gpio already in /etc/modules, skipping" -else - echo "Adding pps-gpio to /etc/modules" - sudo bash -c "echo 'pps-gpio' >> /etc/modules" -fi +echo "Fully upgrading" +sudo apt dist-upgrade -y echo "Cleaning up" -sudo apt autoremove # cleanup +sudo apt autoremove echo "Rebooting in 5 minutes" sudo shutdown -r +5 \ No newline at end of file diff --git a/installer3.sh b/installer3.sh index 2941c2a..ca882a5 100644 --- a/installer3.sh +++ b/installer3.sh @@ -1,33 +1,67 @@ #!/bin/bash set -e -if [ ! -z $SUDO_USER ]; then - username=$SUDO_USER + +# grafana repo and install +echo "Add Grafana repo" +sudo mkdir -p /etc/apt/keyrings/ +wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/null +echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee /etc/apt/sources.list.d/grafana.list + +# telegraf repo and install +echo "Add Telegraf repo" +curl --silent --location -O \ +https://repos.influxdata.com/influxdata-archive.key \ +&& echo "943666881a1b8d9b849b74caebf02d3465d6beb716510d86a39f6c8e8dac7515 influxdata-archive.key" \ +| sha256sum -c - && cat influxdata-archive.key \ +| gpg --dearmor \ +| sudo tee /etc/apt/trusted.gpg.d/influxdata-archive.gpg > /dev/null \ +&& echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive.gpg] https://repos.influxdata.com/debian stable main' \ +| sudo tee /etc/apt/sources.list.d/influxdata.list + +# remove dat key file thing +if [ -f ./influxdata-archive.key ]; then + echo "Removing ./influxdata-archive.key" + rm -f ./influxdata-archive.key else - username=$USER + echo "./influxdata-archive.key not found, skipping delete" fi -# handle users serial shit -## self -echo "Giving $username the right permissions" -sudo usermod -aG dialout $username -## service users -echo "Giving service users the right permissions" -sudo usermod -aG dialout gpsd -sudo usermod -aG dialout _chrony +# install em +echo "Getting new software lists" +sudo apt update -# reconfigure to normal mode -echo "Starting configure script" -bash ./reconfig_full.sh ./working-normal-level-conf +echo "Installing packages" +sudo apt install telegraf grafana influxdb pps-tools gpsd gpsd-clients chrony syslog-ng gh lynx btop htop iptraf iotop neovim -y 2>/dev/null -# enable services -echo "Enabling Services" -sudo systemctl enable gpsd -sudo systemctl enable chrony -sudo systemctl enable influxdb -sudo systemctl enable telegraf -sudo systemctl enable grafana-server -sudo systemctl enable syslog-ng +# check if /boot/firmware/config.txt is configured yet +grep -q -e "GPS PPS signals" /boot/firmware/config.txt +grepconfig=$? + +# configure the overlay +if [ $grepconfig -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" + sudo bash -c "echo '# the next 3 lines are for GPS PPS signals' >> /boot/firmware/config.txt" + sudo bash -c "echo 'dtoverlay=pps-gpio,gpiopin=18' >> /boot/firmware/config.txt" + sudo bash -c "echo 'enable_uart=1' >> /boot/firmware/config.txt" + 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 [ $gerppps -eq 0 ]; then + echo "pps-gpio already in /etc/modules, skipping" +else + echo "Adding pps-gpio to /etc/modules" + sudo bash -c "echo 'pps-gpio' >> /etc/modules" +fi + +echo "Cleaning up" +sudo apt autoremove # cleanup -# reboot rq echo "Rebooting in 5 minutes" sudo shutdown -r +5 \ No newline at end of file diff --git a/installer4.sh b/installer4.sh new file mode 100644 index 0000000..2941c2a --- /dev/null +++ b/installer4.sh @@ -0,0 +1,33 @@ +#!/bin/bash +set -e +if [ ! -z $SUDO_USER ]; then + username=$SUDO_USER +else + username=$USER +fi + +# handle users serial shit +## self +echo "Giving $username the right permissions" +sudo usermod -aG dialout $username +## service users +echo "Giving service users the right permissions" +sudo usermod -aG dialout gpsd +sudo usermod -aG dialout _chrony + +# reconfigure to normal mode +echo "Starting configure script" +bash ./reconfig_full.sh ./working-normal-level-conf + +# enable services +echo "Enabling Services" +sudo systemctl enable gpsd +sudo systemctl enable chrony +sudo systemctl enable influxdb +sudo systemctl enable telegraf +sudo systemctl enable grafana-server +sudo systemctl enable syslog-ng + +# reboot rq +echo "Rebooting in 5 minutes" +sudo shutdown -r +5 \ No newline at end of file