mirror of
https://github.com/gtxaspec/wz_mini_hacks.git
synced 2024-11-25 23:07:17 +00:00
fix logging in upgrade mode
This commit is contained in:
parent
7e788687dd
commit
43a631e0c0
@ -1,12 +1,29 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
setup() {
|
if [ -L /dev/fd ]; then
|
||||||
exec 1>> /opt/wz_upgrade.log 2>&1
|
echo fd exists
|
||||||
|
else
|
||||||
|
echo fd does not exist, link
|
||||||
|
ln -s /proc/self/fd /dev/fd
|
||||||
|
fi
|
||||||
|
|
||||||
|
LOG_FILE=/opt/wz_upgrade.log
|
||||||
|
exec > >(busybox tee -a ${LOG_FILE}) 2>&1
|
||||||
|
|
||||||
|
setup() {
|
||||||
|
|
||||||
|
echo "Create Upgrade directory"
|
||||||
mkdir /opt/Upgrade
|
mkdir /opt/Upgrade
|
||||||
|
|
||||||
|
echo "Create backup files directory"
|
||||||
mkdir /opt/Upgrade/preserve
|
mkdir /opt/Upgrade/preserve
|
||||||
|
|
||||||
|
echo "Download latest master"
|
||||||
wget --no-check-certificate https://github.com/gtxaspec/wz_mini_hacks/archive/refs/heads/master.zip -O /opt/Upgrade/wz_mini.zip; sync
|
wget --no-check-certificate https://github.com/gtxaspec/wz_mini_hacks/archive/refs/heads/master.zip -O /opt/Upgrade/wz_mini.zip; sync
|
||||||
|
|
||||||
|
echo "Extract archive"
|
||||||
unzip /opt/Upgrade/wz_mini.zip -d /opt/Upgrade/
|
unzip /opt/Upgrade/wz_mini.zip -d /opt/Upgrade/
|
||||||
|
|
||||||
cp /opt/wz_mini/wz_mini.conf /opt/Upgrade/preserve/
|
cp /opt/wz_mini/wz_mini.conf /opt/Upgrade/preserve/
|
||||||
cp -r /opt/wz_mini/etc/ssh /opt/Upgrade/preserve/
|
cp -r /opt/wz_mini/etc/ssh /opt/Upgrade/preserve/
|
||||||
cp -r /opt/wz_mini/etc/wireguard /opt/Upgrade/preserve/
|
cp -r /opt/wz_mini/etc/wireguard /opt/Upgrade/preserve/
|
||||||
@ -16,7 +33,6 @@ reboot
|
|||||||
|
|
||||||
|
|
||||||
upgrade_mode_start() {
|
upgrade_mode_start() {
|
||||||
exec 1>> /opt/wz_upgrade.log 2>&1
|
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user