1748952647

This commit is contained in:
2025-06-03 06:10:46 -06:00
parent 295b381223
commit 8ba460683d
5 changed files with 100 additions and 100 deletions
-10
View File
@@ -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
+5 -10
View File
@@ -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
+5 -57
View File
@@ -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
+57 -23
View File
@@ -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
+33
View File
@@ -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