Nimdy / Dedicated_Valheim_Server_Script

Valheim Server Manager . Supports: ValheimPlus, Bepinex, Multi-world, Multi-Lang, Update, Backup, Restore and more: Built for Linux
GNU Affero General Public License v3.0
697 stars 120 forks source link

Automatic save of config files #174

Closed lightface79 closed 3 years ago

lightface79 commented 3 years ago

Hi!

Running the Valheim Plus service.. love your menus.

But needed to try the upgrade funktion hense there was a update today on the plus.

the upgrade worked like it should.

BUT!!!! The config file was erased and replaced with a new config file. So needed to redo all my setings on plus config file.

Can u add a option to save the old file somwere so i can check what i changed and put it in the new config.

Best regards Janne// Sweden

Nimdy commented 3 years ago

I added it already because I knew their configs would overwrite...

but I did not check the backup directory.

I added it

     tput setaf 2;  echo "Update found!" ; tput setaf 9; 
 tput setaf 2;  echo "Do you wish to continue?" ; tput setaf 9; 
   read -p "Please confirm:" confirmValPlusUpdate
  if [ "$confirmValPlusUpdate" == "y" ]; then
    tput setaf 2; echo "Making quick backup of valheim_plus.cfg" ; tput setaf 9; 
    dldir=$backupPath
    [ ! -d "$dldir" ] && mkdir -p "$dldir"
        sleep 1
    cp ${valheimInstallPath}/BepInEx/config/valheim_plus.cfg ${backupPath}/valheim_plus.cfg.old-$(date +"%m-%d-%y-%r")
    tput setaf 2; echo "Grabbing Latest from Valheim Plus and Installing!" ; tput setaf 9; 
lightface79 commented 3 years ago

Ok so it is already added the backup prcidure in the last update u made? or the backup directory was not set to a specific location?

lightface79 commented 3 years ago

When we do a -16 backup World Data can u implement the config files as well in that backup =)

Thanks again

Nimdy commented 3 years ago

The config file for Valheim+ was not being saved because the backup directory was not created, if backsups where never used.

Now it will check if the backup dir is created and if not, create it and then dump a copy over.

Not sure, if I should had the v+ config to the backup tar... but I can add the backup script to make a copy of the v+ config and place it in the backup dir.

V+ is going to have soooo many changes... its going to be a crazy ride. I will come up with something... let me think about it.

Nimdy commented 3 years ago

added and tested.