1748956374

This commit is contained in:
2025-06-03 07:12:53 -06:00
parent 9fabc93055
commit b9a7433b7c
6 changed files with 33 additions and 35 deletions
+12 -12
View File
@@ -2,13 +2,13 @@
# set -e
# grafana repo and install
echo "Add Grafana repo"
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"
echo "Add Telegraf repo..."
curl --silent --location -O \
https://repos.influxdata.com/influxdata-archive.key \
&& echo "943666881a1b8d9b849b74caebf02d3465d6beb716510d86a39f6c8e8dac7515 influxdata-archive.key" \
@@ -20,18 +20,18 @@ https://repos.influxdata.com/influxdata-archive.key \
# remove dat key file thing
if [ -f ./influxdata-archive.key ]; then
echo "Removing ./influxdata-archive.key"
echo "Removing ./influxdata-archive.key..."
rm -f ./influxdata-archive.key
else
echo "./influxdata-archive.key not found, skipping delete"
echo "./influxdata-archive.key not found, skipping delete..."
fi
# install em
echo "Getting new software lists..."
sudo apt update 2>/dev/null 1>/dev/null
sudo apt update 1>/dev/null
echo "Installing packages, this may take a while..."
sudo apt install telegraf grafana influxdb pps-tools gpsd gpsd-clients chrony syslog-ng gh lynx btop htop iptraf iotop neovim netcat-traditional -y 2>/dev/null 1>/dev/null
sudo apt install telegraf grafana influxdb pps-tools gpsd gpsd-clients chrony syslog-ng gh lynx btop htop iptraf iotop neovim netcat-traditional -y 1>/dev/null
# check if /boot/firmware/config.txt is configured yet
grep -q -e "GPS PPS signals" /boot/firmware/config.txt
@@ -39,9 +39,9 @@ grepconfig=$?
# configure the overlay
if [ $grepconfig -eq 0 ]; then
echo "/boot/firmware/config.txt already updated, skipping"
echo "/boot/firmware/config.txt already updated, skipping..."
else
echo "Adding lines to /boot/firmware/config.txt to enable pps and gpio uart"
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"
@@ -54,14 +54,14 @@ gerppps=$?
# add pps-gpio to modules
if [ $gerppps -eq 0 ]; then
echo "pps-gpio already in /etc/modules, skipping"
echo "pps-gpio already in /etc/modules, skipping..."
else
echo "Adding pps-gpio to /etc/modules"
echo "Adding pps-gpio to /etc/modules..."
sudo bash -c "echo 'pps-gpio' >> /etc/modules"
fi
echo "Cleaning up"
sudo apt autoremove 2>/dev/null 1>/dev/null # cleanup
echo "Cleaning up..."
sudo apt autoremove 1>/dev/null # cleanup
echo "Rebooting now!"
sudo reboot