Check AdGuard WebUI Setup is done

this is needed if anyone runs the updatescript without having run the setup in the webui before.

This will lead to an error in on the cp command for the backup.

Made a check around that :)
pull/1181/head
nicedevil007 2 years ago
parent 4dbb2ce906
commit e1623e2104
  1. 4
      ct/alpine-adguard-v5.sh

@ -361,10 +361,12 @@ VER=$(curl -sqI https://github.com/AdguardTeam/AdGuardHome/releases/latest | awk
msg_info "Updating AdguardHome to $VER" msg_info "Updating AdguardHome to $VER"
wget -q "https://github.com/AdguardTeam/AdGuardHome/releases/download/$VER/AdGuardHome_linux_amd64.tar.gz" wget -q "https://github.com/AdguardTeam/AdGuardHome/releases/download/$VER/AdGuardHome_linux_amd64.tar.gz"
tar -xvf AdGuardHome_linux_amd64.tar.gz &>/dev/null tar -xvf AdGuardHome_linux_amd64.tar.gz &>/dev/null
if test -f "/opt/AdGuardHome/AdGuardHome.yaml"; then
mkdir -p adguard-backup mkdir -p adguard-backup
cp -r /opt/AdGuardHome/AdGuardHome.yaml /opt/AdGuardHome/data adguard-backup/ cp -r /opt/AdGuardHome/AdGuardHome.yaml /opt/AdGuardHome/data adguard-backup/
cp AdGuardHome/AdGuardHome /opt/AdGuardHome/AdGuardHome cp AdGuardHome/AdGuardHome /opt/AdGuardHome/AdGuardHome
cp -r adguard-backup/* /opt/AdGuardHome/ cp -r adguard-backup/* /opt/AdGuardHome/
fi
msg_ok "Updated AdguardHome" msg_ok "Updated AdguardHome"
msg_info "Starting AdguardHome" msg_info "Starting AdguardHome"
@ -429,7 +431,7 @@ bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/c
msg_info "Starting LXC Container" msg_info "Starting LXC Container"
pct start $CTID pct start $CTID
msg_ok "Started LXC Container" msg_ok "Started LXC Container"
lxc-attach -n $CTID -- ash -c "$(wget -qO - https://raw.githubusercontent.com/nicedevil007/Proxmox/alpine-adguard-LXC/install/$var_install.sh)" || exit lxc-attach -n $CTID -- ash -c "$(wget -qO - https://raw.githubusercontent.com/tteck/Proxmox/main/install/$var_install.sh)" || exit
IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1) IP=$(pct exec $CTID ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
pct set $CTID -description "# ${APP} LXC pct set $CTID -description "# ${APP} LXC
### https://tteck.github.io/Proxmox/ ### https://tteck.github.io/Proxmox/

Loading…
Cancel
Save