mirror of
https://github.com/teddysun/across.git
synced 2025-01-31 12:19:35 +08:00
Update wireguard.sh
This commit is contained in:
parent
06fc6a002c
commit
9bdc797c7a
19
wireguard.sh
19
wireguard.sh
@ -637,23 +637,20 @@ install_from_source() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
update_from_source() {
|
update_from_source() {
|
||||||
if check_version; then
|
if check_version > /dev/null 2>&1; then
|
||||||
_get_latest_ver
|
_get_latest_ver
|
||||||
echo "WireGuard latest version: $(_green ${wireguard_ver})"
|
_info "WireGuard version: $(_green ${installed_wg_ver})"
|
||||||
|
_info "WireGuard latest version: $(_green ${wireguard_ver})"
|
||||||
if _version_gt "${wireguard_ver}" "${installed_wg_ver}"; then
|
if _version_gt "${wireguard_ver}" "${installed_wg_ver}"; then
|
||||||
echo "Do you want to upgrade WireGuard? (y/n)"
|
_info "Starting upgrade WireGuard"
|
||||||
read -p "(Default: n):" update_wg
|
|
||||||
[ -z "${update_wg}" ] && update_wg="n"
|
|
||||||
if [ "${update_wg}" = "y" -o "${update_wg}" = "Y" ]; then
|
|
||||||
install_wg_2
|
install_wg_2
|
||||||
systemctl restart wg-quick@${SERVER_WG_NIC}
|
_error_detect "systemctl restart wg-quick@${SERVER_WG_NIC}"
|
||||||
echo "Update WireGuard completed"
|
_info "Update WireGuard completed"
|
||||||
else
|
else
|
||||||
echo "Update WireGuard canceled"
|
_info "There is no update available for WireGuard"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "No updates needed to update WireGuard"
|
_red "WireGuard was not installed, maybe you need to install it at first\n"
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user