From 7e3798d8af93091f44dcae652533d5a606646ae8 Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Tue, 3 Jun 2025 04:41:01 -0600 Subject: [PATCH] 1748947261 --- dump_configs.sh | 6 ++++++ reconfig_full.sh | 3 +-- restart_services.sh | 8 +------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/dump_configs.sh b/dump_configs.sh index c2a12b5..afdf100 100644 --- a/dump_configs.sh +++ b/dump_configs.sh @@ -7,9 +7,14 @@ else username=$USER fi +echo "Backing up configs" + dname=./conf-$(date +%s) + +echo "Making $dname" mkdir $dname +echo "Copying the config files" sudo cp /etc/default/gpsd $dname/gpsd sudo cp /etc/chrony/chrony.conf $dname/chrony.conf sudo cp /etc/grafana/grafana.ini $dname/grafana.ini @@ -17,6 +22,7 @@ sudo cp /etc/influxdb/influxdb.conf $dname/influxdb.conf sudo cp /etc/telegraf/telegraf.conf $dname/telegraf.conf sudo cp /etc/udev/rules.d/50-tty.rules $dname/50-tty.rules 2> /dev/null +echo "Fixing permissions in $dname" sudo chown -R $username:$username $dname sudo chmod 775 $dname sudo chmod 664 $dname/* \ No newline at end of file diff --git a/reconfig_full.sh b/reconfig_full.sh index 915403e..513a5d9 100644 --- a/reconfig_full.sh +++ b/reconfig_full.sh @@ -30,13 +30,12 @@ bash ./stop_services.sh bash ./dump_configs.sh # replace dem by truncation +echo "Placing the new config files" sudo bash -c "cat $gpsd_new > $gpsd" sudo bash -c "cat $chrony_new > $chrony" sudo bash -c "cat $grafana_new > $grafana" sudo bash -c "cat $influxdb_new > $influxdb" sudo bash -c "cat $telegraf_new > $telegraf" - -sudo touch $udev_rule # workaround because weird error sudo bash -c "cat $udev_new > $udev_rule" # restart da services diff --git a/restart_services.sh b/restart_services.sh index bc7c77f..d83e299 100644 --- a/restart_services.sh +++ b/restart_services.sh @@ -1,9 +1,3 @@ #!/bin/bash echo "Restarting Services" -sudo systemctl restart gpsd chrony influxdb telegraf grafana-server syslog-ng -# sudo systemctl restart gpsd -# sudo systemctl restart chrony -# sudo systemctl restart influxdb -# sudo systemctl restart telegraf -# sudo systemctl restart grafana-server -# sudo systemctl restart syslog-ng \ No newline at end of file +sudo systemctl restart gpsd chrony influxdb telegraf grafana-server syslog-ng \ No newline at end of file