k0boldz \

This commit is contained in:
2025-10-14 09:06:04 -06:00
parent d9e0606a8a
commit 8ce06c9055
+35 -36
View File
@@ -48,50 +48,50 @@ run_reboot () {
} }
dump_configs { dump_configs {
dname=./conf-$(date +%s) dname=./conf-$(date +%s)
long_sleep long_sleep
echo -e "\nBacking up configa\n" echo -e "\nBacking up configa\n"
echo -e "\nMaking $dname\n" echo -e "\nMaking $dname\n"
mkdir $dname mkdir $dname
echo "Copying the config files" echo "Copying the config files"
echo -e "\tBacking up gpsd config" echo -e "\tBacking up gpsd config"
sudo cp /etc/default/gpsd $dname/gpsd sudo cp /etc/default/gpsd $dname/gpsd
echo -e "\tBacking up chrony config" echo -e "\tBacking up chrony config"
sudo cp /etc/chrony/chrony.conf $dname/chrony.conf sudo cp /etc/chrony/chrony.conf $dname/chrony.conf
echo -e "\tBacking up grafana config" echo -e "\tBacking up grafana config"
sudo cp /etc/grafana/grafana.ini $dname/grafana.ini sudo cp /etc/grafana/grafana.ini $dname/grafana.ini
echo -e "\tBacking up influxdb config" echo -e "\tBacking up influxdb config"
sudo cp /etc/influxdb/influxdb.conf $dname/influxdb.conf sudo cp /etc/influxdb/influxdb.conf $dname/influxdb.conf
echo -e "\tBacking up telegraf config" echo -e "\tBacking up telegraf config"
sudo cp /etc/telegraf/telegraf.conf $dname/telegraf.conf sudo cp /etc/telegraf/telegraf.conf $dname/telegraf.conf
echo -e "\tBacking up /boot/firmware/config.txt" echo -e "\tBacking up /boot/firmware/config.txt"
sudo cp /boot/firmware/config.txt $dname/boot-firmware-config.txt sudo cp /boot/firmware/config.txt $dname/boot-firmware-config.txt
echo -e "\tBacking up gheclock-set config" echo -e "\tBacking up gheclock-set config"
# sudo cp /lib/udev/hwclock-set $dname/hwclock-set # sudo cp /lib/udev/hwclock-set $dname/hwclock-set
echo -e "\tBacking up root crontab" echo -e "\tBacking up root crontab"
sudo crontab -l > $dname/root-crontab sudo crontab -l > $dname/root-crontab
echo -e "\tBacking up /etc/modules" echo -e "\tBacking up /etc/modules"
sudo cp /etc/modules $dname/root-crontab sudo cp /etc/modules $dname/root-crontab
if [ -f /etc/udev/rules.d/50-tty.rules ]; then if [ -f /etc/udev/rules.d/50-tty.rules ]; then
echo "/etc/udev/rules.d/50-tty.rules found, copying as well..." echo "/etc/udev/rules.d/50-tty.rules found, copying as well..."
sudo cp /etc/udev/rules.d/50-tty.rules $dname/50-tty.rules sudo cp /etc/udev/rules.d/50-tty.rules $dname/50-tty.rules
fi fi
echo "Fixing permissions in $dname..." echo "Fixing permissions in $dname..."
sudo chown -R $username:$username $dname sudo chown -R $username:$username $dname
sudo chmod 775 $dname sudo chmod 775 $dname
sudo chmod 664 $dname/* sudo chmod 664 $dname/*
echo "Compressing up and deleting $dname to $dname.tar.gz..." echo "Compressing up and deleting $dname to $dname.tar.gz..."
tar czf $dname.tar.gz $dname tar czf $dname.tar.gz $dname
rm -rf $dname rm -rf $dname
echo "dump_configs.sh complete" >> ./status.txt echo "dump_configs complete" >> ./status.txt
} }
reconfigure_full () { reconfigure_full () {
@@ -128,8 +128,7 @@ reconfigure_full () {
# stop da services # stop da services
bash $git_dir/services.sh stop bash $git_dir/services.sh stop
# backup conf dump_configs
bash $git_dir/dump_configs.sh
# replace dem by truncation # replace dem by truncation
echo "Placing the new config files by truncation..." echo "Placing the new config files by truncation..."