Kevin Windrem avatar image
Kevin Windrem suggested

Enhance restore to factory defaults to include Venus OS reinstall

I keep seeing posts of people loosing access to the GUI for whatever reason and not being able to recover even after restoring settings to factory defaults. Part of the restore settings mechanism blocks ssh access so it's a double whammy.

I have a mechanism that forces a Venus OS firmware update as part of my SetupHelper blind uninstall mechanism. I recommend that this be added to the restore to factory defaults venus-data.tgz.

I also rename venus-data.tgz so it won't run again if the media is left plugged in.

Here's the shell script code I used:

# check to see if Venus OS will be reinstalled - actuall reinstall will be done later
swCheckOutput=$(/opt/victronenergy/swupdate-scripts/ -offline -force -check)
if (( $? == 0 )); then
    swUpdateVersion=$(echo $swCheckOutput | awk '{print $NF}')

# reinstall Venus OS - done in background so this script can clean up and exit without disrupting the software update
if $reinstallVenusOs ; then
    logMessage "reinstalling Venus OS $swUpdateVersion"
    nohup sh -c 'sleep 1; /opt/victronenergy/swupdate-scripts/ -offline -force -update' > /dev/null &
# reboot if not reinstalling Venus OS
    logMessage "rebooting ..."
    nohup sh -c 'sleep 1; reboot' > /dev/null &

# rename archive on removable media to prevent blindInstall from running again
drives=$(ls /run/media/)
for drive in $drives ; do
    if [ -f "$archive" ]; then
        logMessage "renaming venus-data.tar.gz so blindUninstall won't run again"
        mv $archive "/run/media/$drive/venus-data.UninstallPackages.tar.gz"

restore to factory defaults
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

1 Comment

mvader (Victron Energy) avatar image
mvader (Victron Energy) commented

Hey Kevin, thanks for your post here. It triggered a better solution:

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.

Related Ideas