Merge pull request #60 from claudobahn/upgrade_tweaks

Preserve all SSH configuration, including host keys, and also preserve Wireguard keys.
This commit is contained in:
gtxaspec 2022-05-28 20:36:22 -07:00 committed by GitHub
commit 1be5582525
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,8 @@ mkdir /opt/Upgrade/preserve
wget --no-check-certificate https://github.com/gtxaspec/wz_mini_hacks/archive/refs/heads/master.zip -O /opt/Upgrade/wz_mini.zip; sync
unzip /opt/Upgrade/wz_mini.zip -d /opt/Upgrade/
cp /opt/wz_mini/wz_mini.conf /opt/Upgrade/preserve/
cp /opt/wz_mini/etc/ssh/authorized_keys /opt/Upgrade/preserve/
cp -r /opt/wz_mini/etc/ssh /opt/Upgrade/preserve/
cp -r /opt/wz_mini/etc/wireguard /opt/Upgrade/preserve/
sync
reboot
}
@ -22,8 +23,10 @@ mv /opt/Upgrade/wz_mini_hacks-master/SD_ROOT/wz_mini/* /opt/wz_mini/
rm -f /opt/factory_t31_ZMC6tiIDQN
mv /opt/Upgrade/wz_mini_hacks-master/SD_ROOT/factory_t31_ZMC6tiIDQN /opt/factory_t31_ZMC6tiIDQN
cp /opt/Upgrade/preserve/authorized_keys /opt/wz_mini/etc/ssh/
diff /opt/wz_mini/wz_mini.conf /opt/Upgrade/preserve/wz_mini.conf
cp /opt/Upgrade/preserve/wz_mini.conf /opt/wz_mini/
cp /opt/Upgrade/preserve/ssh/* /opt/wz_mini/etc/ssh/
cp -r /opt/Upgrade/preserve/wireguard /opt/wz_mini/etc/
rm -rf /opt/Upgrade
sync
reboot