k0boldz \

This commit is contained in:
2025-10-14 09:05:17 -06:00
parent f969417379
commit d9e0606a8a
2 changed files with 47 additions and 42 deletions
-42
View File
@@ -7,45 +7,3 @@ else
username=$USER
fi
echo "Backing up configs..."
dname=./conf-$(date +%s)
echo "Making $dname"
mkdir $dname
echo "Copying the config files"
echo -e "\tBacking up gpsd config"
sudo cp /etc/default/gpsd $dname/gpsd
echo -e "\tBacking up chrony config"
sudo cp /etc/chrony/chrony.conf $dname/chrony.conf
echo -e "\tBacking up grafana config"
sudo cp /etc/grafana/grafana.ini $dname/grafana.ini
echo -e "\tBacking up influxdb config"
sudo cp /etc/influxdb/influxdb.conf $dname/influxdb.conf
echo -e "\tBacking up telegraf config"
sudo cp /etc/telegraf/telegraf.conf $dname/telegraf.conf
echo -e "\tBacking up /boot/firmware/config.txt"
sudo cp /boot/firmware/config.txt $dname/boot-firmware-config.txt
echo -e "\tBacking up gheclock-set config"
sudo cp /lib/udev/hwclock-set $dname/hwclock-set
echo -e "\tBacking up root crontab"
sudo crontab -l > $dname/root-crontab
echo -e "\tBacking up /etc/modules"
sudo cp /etc/modules $dname/root-crontab
if [ -f /etc/udev/rules.d/50-tty.rules ]; then
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
fi
echo "Fixing permissions in $dname..."
sudo chown -R $username:$username $dname
sudo chmod 775 $dname
sudo chmod 664 $dname/*
echo "Compressing up and deleting $dname to $dname.tar.gz..."
tar czf $dname.tar.gz $dname
rm -rf $dname
echo "dump_configs.sh complete" >> ./status.txt
+47
View File
@@ -47,6 +47,53 @@ run_reboot () {
sudo shutdown -r +$long_delay
}
dump_configs {
dname=./conf-$(date +%s)
long_sleep
echo -e "\nBacking up configa\n"
echo -e "\nMaking $dname\n"
mkdir $dname
echo "Copying the config files"
echo -e "\tBacking up gpsd config"
sudo cp /etc/default/gpsd $dname/gpsd
echo -e "\tBacking up chrony config"
sudo cp /etc/chrony/chrony.conf $dname/chrony.conf
echo -e "\tBacking up grafana config"
sudo cp /etc/grafana/grafana.ini $dname/grafana.ini
echo -e "\tBacking up influxdb config"
sudo cp /etc/influxdb/influxdb.conf $dname/influxdb.conf
echo -e "\tBacking up telegraf config"
sudo cp /etc/telegraf/telegraf.conf $dname/telegraf.conf
echo -e "\tBacking up /boot/firmware/config.txt"
sudo cp /boot/firmware/config.txt $dname/boot-firmware-config.txt
echo -e "\tBacking up gheclock-set config"
# sudo cp /lib/udev/hwclock-set $dname/hwclock-set
echo -e "\tBacking up root crontab"
sudo crontab -l > $dname/root-crontab
echo -e "\tBacking up /etc/modules"
sudo cp /etc/modules $dname/root-crontab
if [ -f /etc/udev/rules.d/50-tty.rules ]; then
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
fi
echo "Fixing permissions in $dname..."
sudo chown -R $username:$username $dname
sudo chmod 775 $dname
sudo chmod 664 $dname/*
echo "Compressing up and deleting $dname to $dname.tar.gz..."
tar czf $dname.tar.gz $dname
rm -rf $dname
echo "dump_configs.sh complete" >> ./status.txt
}
reconfigure_full () {
# make sure dir works
if [ -z $1 ] || [ ! -d "$1" ]; then