Reactor Update Shell Script *Use at your Own Risk*
-
Hello all, just thought I'd share my shells script I created to streamline the update process for MSR. Please use this at your own risk.
Here's what you gotta put into your
.sh
file:#!/bin/bash sudo cp -r {path_to_reactor_folder} {path_to_backup_location}-$(date +'%Y_%m_%d_%H:%M') FILE=$(find {path_to_directory_above_reactor_folder} -maxdepth 1 -type f) sudo systemctl stop reactor sleep 5s cd {path_to_directory_above_reactor_folder} tar xzvf $FILE sleep 30s sudo find {path_to_reactor_folder} -name "package-lock.json" -delete sleep 10s cd {path_to_reactor_filder} npm run deps sleep 30s sudo systemctl restart reactor
The only requirement is that you have drop the updated Reactor
.tar.gz
file in the directory above your Reactor folder and then run the script. Once that is done run the script you created above (remember to update the paths) and everything should take care of itself. I added thesleep
command in a few lines but don't think it's needed.Edit: I also added in the first line of the script a copy command. This will backup your reactor directory to whatever location you'd like and also name it with the date and time. I have my NAS mounted so that is where reactor gets backed up to. Ideally you'd want to backup your Reactor directly off-site just in case your RPi craps out.
-
This is very similar to a cheat sheet I keep handy. However, I ran into this:
gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now
-
If you use
$1
instead of$FILE
in the script the path to the Reactor build could just be given on the command line and the script won't have to assume/enforce a location. -
@gwp1 If your reactor folder is
/home/user/documents/reactor
yourtar.gz
file should be inhome/user/documents
. But thats not what the error is showing, looks like the Reactor update file isn't in.gz
compressed format, I know with certain browsers like Safari they will auto decompress downloaded files. -
T toggledbits locked this topic on