Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion ct/adguard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,38 @@ function update_script() {
msg_error "No ${APP} Installation Found!"
exit
fi
msg_error "Adguard Home can only be updated via the user interface."
if check_for_gh_release "AdGuardHome" "AdguardTeam/AdGuardHome"; then
read -r -p "It is recommended to update AdGuard Home from the web interface. Would you like to continue with a manual update? <y/N> " prompt
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
msg_info "Installing AdGuard Home to temporary location"
fetch_and_deploy_gh_release "AdGuardHome" "AdguardTeam/AdGuardHome" "prebuild" "latest" "/opt/AdGuardHome.temp" "AdGuardHome_linux_amd64.tar.gz"
msg_ok "Installed AdGuard Home to temporary location"

msg_info "Stopping Service"
systemctl stop AdGuardHome
msg_ok "Stopped Service"

msg_info "Backing up Configuration"
cp /opt/AdGuardHome/AdGuardHome.yaml /opt/AdGuardHome.yaml
cp -r /opt/AdGuardHome/data /opt/AdGuardHome_data
msg_ok "Backed up Configuration"

msg_info "Moving new AdGuard Home to correct location"
rm -rf /opt/AdGuardHome
mv /opt/AdGuardHome.temp /opt/AdGuardHome
msg_ok "Moved new AdGuard Home to correct location"

msg_info "Restoring Configuration"
mv /opt/AdGuardHome.yaml /opt/AdGuardHome/AdGuardHome.yaml
rm -rf /opt/AdGuardHome/data
mv /opt/AdGuardHome_data /opt/AdGuardHome/data
msg_ok "Restored Configuration"

msg_info "Starting Service"
systemctl start AdGuardHome
msg_ok "Started Service"
fi
fi
exit
}

Expand Down
2 changes: 1 addition & 1 deletion frontend/public/json/adguard.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
"notes": [
{
"text": "AdGuard Home can only be updated via the user interface.",
"text": "It is recommended to update AdGuard Home via its web interface. Use the update function only if this fails.",
"type": "info"
}
]
Expand Down