From 5a4feaa8bce8030934a12e783881a679974a8445 Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Tue, 14 Oct 2025 02:51:59 -0600 Subject: [PATCH] testan a reboold --- installer1.sh | 10 ++++++++-- installer2.sh | 8 +++++++- installer3.sh | 20 ++++++++++---------- installer4.sh | 10 ++++++++-- installer_auto.sh | 4 ++-- 5 files changed, 35 insertions(+), 17 deletions(-) diff --git a/installer1.sh b/installer1.sh index c0fa78a..d979475 100644 --- a/installer1.sh +++ b/installer1.sh @@ -1,5 +1,11 @@ #!/bin/bash -set -e +# set -e + +if [ ! -z $SUDO_USER ]; then + username=$SUDO_USER +else + username=$USER +fi # rpi-update # echo "Updating Raspberry Pi firmware..." @@ -12,7 +18,7 @@ echo -e "Enable I2C Support in raspi-config\n\tInterface Options->I2C->\n\t Woul read -p "Press ENTER to Continue" sudo raspi-config -echo "Installer1.sh complete" >> ./status.txt +echo "Installer1.sh complete" >> /home/$username/Precision-Timekeeping-Fuckery/status.txt echo "Part 1 Done!" # echo "Rebooting now!" diff --git a/installer2.sh b/installer2.sh index 5147eca..058881e 100644 --- a/installer2.sh +++ b/installer2.sh @@ -1,13 +1,19 @@ #!/bin/bash # set -e +if [ ! -z $SUDO_USER ]; then + username=$SUDO_USER +else + username=$USER +fi + echo "Fully upgrading, this may take a while..." sudo apt dist-upgrade -y 1>/dev/null echo "Cleaning up..." sudo apt autoremove -y 1>/dev/null -echo "Installer2.sh complete" >> ./status.txt +echo "Installer2.sh complete" >> /home/$username/Precision-Timekeeping-Fuckery/status.txt echo "Part 2 Done!" # echo "Rebooting now!" diff --git a/installer3.sh b/installer3.sh index f691834..e484c55 100644 --- a/installer3.sh +++ b/installer3.sh @@ -1,6 +1,12 @@ #!/bin/bash # set -e +if [ ! -z $SUDO_USER ]; then + username=$SUDO_USER +else + username=$USER +fi + # grafana repo and install echo "Add Grafana repo..." sudo mkdir -p /etc/apt/keyrings/ @@ -41,10 +47,10 @@ sudo apt purge -y "bluetooth*" "usb*" "wireless*" "pci*" "fonts*" "bluez*" "alsa # install da packages echo "Installing packages, this may take a while..." -sudo apt install -y util-linux-extra gawk ripgrep telegraf grafana influxdb unattended-upgrades net-tools htop btop iptraf iotop screen byobu python3 python3-pip python3-virtualenv python3-setuptools thefuck wget lynx nmap zip unzip 7zip net-tools restic ripgrep pps-tools git gh gpsd gpsd-clients chrony syslog-ng gh lynx btop htop iptraf-ng iotop neovim netcat-traditional python3-smbus i2c-tools picocom +sudo apt install -y gawk ripgrep telegraf grafana influxdb unattended-upgrades net-tools htop btop iptraf iotop screen byobu python3 python3-pip python3-virtualenv python3-setuptools thefuck wget lynx nmap zip unzip 7zip net-tools restic ripgrep pps-tools git gh gpsd gpsd-clients chrony syslog-ng gh lynx btop htop iptraf-ng iotop neovim netcat-traditional python3-smbus i2c-tools picocom -echo "Setting hostname to grandfatherclock" -sudo hostnamectl set-hostname grandfatherclock +# echo "Setting hostname to grandfatherclock" +# sudo hostnamectl set-hostname grandfatherclock # check if pps-gpio is in /etc/modules already grep -e "pps-gpio" /etc/modules @@ -61,12 +67,6 @@ fi echo "Cleaning up..." sudo apt autoremove -y -if [ ! -z $SUDO_USER ]; then - username=$SUDO_USER -else - username=$USER -fi - # handle users serial shit ## self echo "Giving $username the right permissions..." @@ -79,7 +79,7 @@ sudo usermod -aG dialout _chrony sudo usermod -aG i2c _chrony sudo usermod -aG i2c gpsd -echo "installer3.sh complete" >> ./status.txt +echo "installer3.sh complete" >> /home/$username/Precision-Timekeeping-Fuckery/status.txt echo "Part 3 Done!" # echo "Rebooting now!" diff --git a/installer4.sh b/installer4.sh index 1091d35..01b86f6 100644 --- a/installer4.sh +++ b/installer4.sh @@ -1,5 +1,11 @@ #!/bin/bash -set -e +# set -e + +if [ ! -z $SUDO_USER ]; then + username=$SUDO_USER +else + username=$USER +fi # reconfigure to normal mode echo "Starting configure script..." @@ -27,7 +33,7 @@ sudo systemctl enable syslog-ng 1>/dev/null echo -e "\tEnabling logrotate on boot" sudo systemctl enable logrotate 1>/dev/null -rm -f ./status.txt +echo "done!" > /home/$username/Precision-Timekeeping-Fuckery/status.txt # reboot rq echo "Part 4 Done!" diff --git a/installer_auto.sh b/installer_auto.sh index 12fe90c..9173b10 100644 --- a/installer_auto.sh +++ b/installer_auto.sh @@ -1,6 +1,6 @@ #!/bin/bash # usage -## curl -s https://raw.githubusercontent.com/PrincessPi3/Precision-Timekeeping-Fuckery/refs/heads/main/installer_auto.sh?nocache=$RANDOM | $SHELL +## curl -s https://raw.githubusercontent.com/PrincessPi3/Precision-Timekeeping-Fuckery/refs/heads/main/installer_auto.sh?nocache=$RANDOM | sudo $SHELL # set -e if [ ! -z $SUDO_USER ]; then @@ -21,4 +21,4 @@ git clone https://github.com/PrincessPi3/Precision-Timekeeping-Fuckery.git cd /home/$username/Precision-Timekeeping-Fuckery echo "Stage 1 Complete" -echo "installer_auto.sh complete" > ./status.txt +echo "installer_auto.sh complete" > /home/$username/Precision-Timekeeping-Fuckery/status.txt