From 1a348a799850ffbdf33ac0947fe0dfa6fc23c0a2 Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Tue, 14 Oct 2025 03:43:44 -0600 Subject: [PATCH] testan a reboold --- info-level-conf/root-crontab | 2 +- installer1.sh | 15 ++++++++++----- installer2.sh | 15 ++++++++++++--- installer3.sh | 16 ++++++++++------ installer4.sh | 12 +++++++++--- installer_auto.sh | 14 +++++++++++++- 6 files changed, 55 insertions(+), 19 deletions(-) diff --git a/info-level-conf/root-crontab b/info-level-conf/root-crontab index 434dc3a..e1d8ae3 100644 --- a/info-level-conf/root-crontab +++ b/info-level-conf/root-crontab @@ -1,4 +1,4 @@ -# m h dom mon dow command # set hardware I2C RTC hourly 0 * * * * /bin/bash -c "/usr/sbin/hwclock -w 2>> /var/log/root-crontab.log" +# webhook to notify of reboot @reboot /usr/share/customscripts/ifnet "/usr/share/customscripts/webhook bootup" 2>> /var/log/root-crontab.log diff --git a/installer1.sh b/installer1.sh index b788f70..1ac1829 100644 --- a/installer1.sh +++ b/installer1.sh @@ -1,15 +1,20 @@ #!/bin/bash # set -e +# get real user if [ ! -z $SUDO_USER ]; then username=$SUDO_USER else username=$USER fi +# initial delay to make sure its good +echo "Sleeping 3 minutes" +sleep 180 + # rpi-update -# echo "Updating Raspberry Pi firmware..." -# sudo rpi-update +echo "Updating Raspberry Pi firmware..." +sudo rpi-update # run da raspberry pi config script clear @@ -18,10 +23,10 @@ echo -e "Enable I2C Support in raspi-config\n\tInterface Options->I2C->\n\t Woul read -p "Press ENTER to Continue" sudo raspi-config +# notify finish echo "Installer1.sh complete" >> /home/$username/Precision-Timekeeping-Fuckery/status.txt - echo "Part 1 Done!" -# echo "Rebooting now!" -# sudo reboot + +# reboot after 3 minutes for safety echo -e "\nREBOOTING IN 3 MINUTES\n" sudo shutdown -r +3 \ No newline at end of file diff --git a/installer2.sh b/installer2.sh index 4b6c227..00bae6f 100644 --- a/installer2.sh +++ b/installer2.sh @@ -1,22 +1,31 @@ #!/bin/bash # set -e +# get real user if [ ! -z $SUDO_USER ]; then username=$SUDO_USER else username=$USER fi +# initial delay to make sure its good +echo "Sleeping 3 minutes" +sleep 180 + +# full distribution upgrade echo "Fully upgrading, this may take a while..." sudo apt dist-upgrade -y +# cleanup echo "Cleaning up..." sudo apt autoremove -y +# notify finish +echo "Part 2 Done!" + +# update the log echo "Installer2.sh complete" >> /home/$username/Precision-Timekeeping-Fuckery/status.txt -echo "Part 2 Done!" -# echo "Rebooting now!" -# sudo reboot +# reboot after 3 minutes for safety echo -e "\nREBOOTING IN 3 MINUTES\n" sudo shutdown -r +3 \ No newline at end of file diff --git a/installer3.sh b/installer3.sh index 5921d0c..35e253e 100644 --- a/installer3.sh +++ b/installer3.sh @@ -1,12 +1,17 @@ #!/bin/bash # set -e +# get real user if [ ! -z $SUDO_USER ]; then username=$SUDO_USER else username=$USER fi +# initial delay to make sure its good +echo "Sleeping 3 minutes" +sleep 180 + # grafana repo and install echo "Add Grafana repo..." sudo mkdir -p /etc/apt/keyrings/ @@ -50,9 +55,6 @@ sudo apt install -y gawk ripgrep telegraf grafana influxdb restic build-essentia echo "Purging unneeded junk..." sudo apt purge -y "bluetooth*" "usb*" "wireless*" "pci*" "fonts*" "bluez*" "alsa*" fake-hwclock build-essential -# 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 gerppps=$? @@ -65,6 +67,7 @@ else sudo bash -c "echo 'pps-gpio' >> /etc/modules" fi +# cleanup echo "Cleaning up..." sudo apt autoremove -y @@ -73,6 +76,7 @@ sudo apt autoremove -y echo "Giving $username the right permissions..." sudo usermod -aG dialout $username sudo usermod -a -G i2c $username +sudo usermod -a -G tty $username ## service users echo "Giving service users the right permissions..." sudo usermod -aG dialout gpsd @@ -96,11 +100,11 @@ echo "Installing general-scripts-and-system-ssssssetup" curl -s https://raw.githubusercontent.com/PrincessPi3/general-scripts-and-system-ssssssetup/refs/heads/main/customscripts/install_script.sh?nocache=$RANDOM | sudo "$SHELL" # update the log -cd /home/$username/Precision-Timekeeping-Fuckery echo "installer3.sh complete" >> /home/$username/Precision-Timekeeping-Fuckery/status.txt +# finish echo "Part 3 Done!" -# echo "Rebooting now!" -# sudo reboot + +# reboot after 3 minutes for safety echo -e "\nREBOOTING IN 3 MINUTES\n" sudo shutdown -r +3 \ No newline at end of file diff --git a/installer4.sh b/installer4.sh index 42e1184..78215f4 100644 --- a/installer4.sh +++ b/installer4.sh @@ -1,12 +1,17 @@ #!/bin/bash # set -e +# get real user if [ ! -z $SUDO_USER ]; then username=$SUDO_USER else username=$USER fi +# initial delay to make sure its good +echo "Sleeping 3 minutes" +sleep 180 + # reconfigure to normal mode echo "Starting configure script..." # info level @@ -33,11 +38,12 @@ sudo systemctl enable syslog-ng echo -e "\tEnabling logrotate on boot" sudo systemctl enable logrotate +# update the log echo "done!" > /home/$username/Precision-Timekeeping-Fuckery/status.txt -# reboot rq +# finish echo "Part 4 Done!" -# echo "Rebooting now!" -# sudo reboot + +# reboot after 3 minutes for safety echo -e "\nREBOOTING IN 3 MINUTES\n" sudo shutdown -r +3 \ No newline at end of file diff --git a/installer_auto.sh b/installer_auto.sh index 3800991..eb10aee 100644 --- a/installer_auto.sh +++ b/installer_auto.sh @@ -3,28 +3,40 @@ ## curl -s https://raw.githubusercontent.com/PrincessPi3/Precision-Timekeeping-Fuckery/refs/heads/main/installer_auto.sh?nocache=$RANDOM | sudo $SHELL # set -e +# get real username (not root) if run with sudo if [ ! -z $SUDO_USER ]; then username=$SUDO_USER else username=$USER fi +# initial delay to make sure its good +echo "Sleeping 3 minutes" +sleep 180 + +# passwordless sudo echo -e "Edit sudoers file\n\t%sudo ALL = (ALL) NOPASSWD: ALL" sudo visudo +# updoot echo "Updating Software Lists" sudo apt update +# install get for next step echo "Installing git" sudo apt install -y git +# download da thing echo "Cloning Repo" cd /home/$username git clone https://github.com/PrincessPi3/Precision-Timekeeping-Fuckery.git -cd /home/$username/Precision-Timekeeping-Fuckery +# done echo "Stage 1 Complete" + +# update the log echo "installer_auto.sh complete" > /home/$username/Precision-Timekeeping-Fuckery/status.txt +# reboot after 3 minutes for safety echo -e "\nREBOOTING IN 3 MINUTES\n" sudo shutdown -r +3 \ No newline at end of file