testan a reboold \

This commit is contained in:
2025-10-14 08:29:26 -06:00
parent 794208726f
commit a0dd51fd90
7 changed files with 35 additions and 50 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
old
*.bak* *.bak*
*.tmp
scratch.* scratch.*
chrony_statistics.log chrony_statistics.log
conf-* conf-*
+34 -49
View File
@@ -32,11 +32,26 @@ installer_status="$git_dir/installer.tmp"
long_delay_seconds=$(($long_delay * 60)) long_delay_seconds=$(($long_delay * 60))
short_delay_seconds=$(($short_delay * 60)) short_delay_seconds=$(($short_delay * 60))
short_sleep () {
echo -e "\nSleeping $short_delay minutes to make sure everything is as stable as possible\n"
sleep $short_delay_seconds
}
long_sleep () {
echo -e "\nSleeping $long_delay minutes to make sure everything is as stable as possible\n"
sleep $long_delay_seconds
}
run_reboot () {
echo -e "\nREBOOTING IN $long_delay MINUTES\n"
sudo shutdown -r +$long_delay
}
reconfigure_full () { reconfigure_full () {
# make sure dir works # make sure dir works
if [ -z $1 ] || [ ! -d "$1" ]; then if [ -z $1 ] || [ ! -d "$1" ]; then
echo "usage bash reconfig_full.sh /path/to/config/dir" echo "usage reconfigure_full /path/to/config/dir"
exit exit 1
fi fi
# paths # paths
@@ -123,9 +138,7 @@ reconfigure_full () {
} }
phase_one () { phase_one () {
# initial delay to make sure its good long_sleep
echo -e "\nSleeping $long_delay minutes to make sure everything is as stable as possible\n"
sleep $long_delay_seconds
# updoot # updoot
echo -e "\nUpdating Software Lists\n" echo -e "\nUpdating Software Lists\n"
@@ -148,23 +161,17 @@ phase_one () {
# done # done
echo -e "\nStage 1/5 Complet\n" echo -e "\nStage 1/5 Complet\n"
# reboot after 3 minutes for safety run_reboot
echo -e "\nREBOOTING IN 3 MINUTES\n"
sudo shutdown -r +$long_delay
} }
phase_two () { phase_two () {
# initial delay to make sure its good long_sleep
echo -e "\nSleeping 3 minutes to make sure everything is as stable as possible\n"
sleep $long_delay_seconds
# rpi-update # rpi-update
echo -e "\nUpdating Raspberry Pi firmware... DO NOT REBOOT\n" echo -e "\nUpdating Raspberry Pi firmware... DO NOT REBOOT\n"
sudo rpi-update sudo rpi-update
# safety delay short_sleep
echo -e "\nSleeping $short_delay_seconds seconds to make sure its as stable as possible\n"
sleep $short_delay_seconds
# run da raspberry pi config script # run da raspberry pi config script
clear clear
@@ -182,15 +189,11 @@ phase_two () {
# update the log # update the log
echo "installer1.sh complete 2/5" >> $status_log echo "installer1.sh complete 2/5" >> $status_log
# reboot after 3 minutes for safety run_reboot
echo -e "\nREBOOTING IN 3 MINUTES\n"
sudo shutdown -r +$long_delay
} }
phase_three () { phase_three () {
# initial delay to make sure its good long_sleep
echo -e "\nSleeping $long_delay minutes to make sure everything is as stable as possible\n"
sleep $long_delay_seconds
# full distribution upgrade # full distribution upgrade
echo -e "\nFully upgrading, this may take a while...\n" echo -e "\nFully upgrading, this may take a while...\n"
@@ -213,15 +216,11 @@ phase_three () {
# update the log # update the log
echo "Installer2.sh complete 3/5" >> $status_log echo "Installer2.sh complete 3/5" >> $status_log
# reboot after 3 minutes for safety run_reboot
echo -e "\nREBOOTING IN 3 MINUTES\n"
sudo shutdown -r +$long_delay
} }
phase_four () { phase_four () {
# initial delay to make sure its good long_sleep
echo -e "\nSleeping 3 minutes to make sure everything is as stable as possible\n"
sleep $long_delay_seconds
# grafana repo and install # grafana repo and install
echo -e "\nAdd Grafana repo...\n" echo -e "\nAdd Grafana repo...\n"
@@ -252,9 +251,7 @@ phase_four () {
echo -e "\nGetting new software lists...\n" echo -e "\nGetting new software lists...\n"
sudo apt update sudo apt update
# safety delay short_sleep
echo -e "\nSleeping 60 seconds to make sure its as stable as possibl\n"
sleep $short_delay_seconds
# clean up # clean up
echo -e "\nDisabling unneeded junk..\n" echo -e "\nDisabling unneeded junk..\n"
@@ -266,9 +263,7 @@ phase_four () {
echo -e "\nInstalling packages, this may take a while...\n" echo -e "\nInstalling packages, this may take a while...\n"
sudo bash -c "apt install -y $packages" sudo bash -c "apt install -y $packages"
# safety delay short_sleep
echo -e "\nSleeping 60 seconds to make sure its as stable as possible\n"
sleep $short_delay_seconds
# purging da junk # purging da junk
# dont actually think this is at worth the space savings # dont actually think this is at worth the space savings
@@ -306,9 +301,7 @@ phase_four () {
sudo usermod -aG tty _chrony sudo usermod -aG tty _chrony
sudo usermod -aG tty gpsd sudo usermod -aG tty gpsd
# safety delay short_sleep
echo -e "\nSleeping 60 seconds to make sure its as stable as possible\n"
sleep $short_delay_seconds
# installing ble.sh # installing ble.sh
echo -e "\nInstalling BLE.sh\n" echo -e "\nInstalling BLE.sh\n"
@@ -318,9 +311,7 @@ phase_four () {
echo -e "\n# ble.sh" >> $bashrc echo -e "\n# ble.sh" >> $bashrc
echo "source -- /home/$username/.local/share/blesh/ble.sh" >> $bashrc echo "source -- /home/$username/.local/share/blesh/ble.sh" >> $bashrc
# safety delay short_sleep
echo -e "\nSleeping 60 seconds to make sure its as stable as possible\n"
sleep $short_delay_seconds
# general-scripts-and-system-ssssssetup # general-scripts-and-system-ssssssetup
echo -e "\nInstalling general-scripts-and-system-ssssssetup\n" echo -e "\nInstalling general-scripts-and-system-ssssssetup\n"
@@ -335,15 +326,11 @@ phase_four () {
# finish # finish
echo -e "\nPart 4/5 Done\n!" echo -e "\nPart 4/5 Done\n!"
# reboot after 3 minutes for safety run_reboot
echo -e "\nREBOOTING IN 3 MINUTES\n"
sudo shutdown -r +$long_delay
} }
phase_five () { phase_five () {
# initial delay to make sure its good long_sleep
echo -e "\nSleeping $long_delay minutes\n"
sleep $long_delay_seconds
# reconfigure to normal mode # reconfigure to normal mode
echo -e "\nStarting configure script...\n" echo -e "\nStarting configure script...\n"
@@ -395,15 +382,13 @@ phase_five () {
# update the log # update the log
echo "installer4.sh done 5/5\nCOMPLETE AT $(date +%s)" >> $status_log echo "installer4.sh done 5/5\nCOMPLETE AT $(date +%s)" >> $status_log
# delete tmp file # finish the tmp file
rm -f $status_log echo "installed" > $installer_status
# finish # finish
echo -e "\nPart 5/5 Done! Yaay! Done!\n" echo -e "\nPart 5/5 Done! Yaay! Done!\n"
# reboot after 3 minutes for safety run_reboot
echo -e "\nREBOOTING IN $long_delay MINUTES\n"
sudo shutdown -r +$long_delay
} }
# do the suto thinggg # do the suto thinggg
View File
View File
View File
View File