feat: add logging for system checks in initialCheck (#1371)

Add debug and info logging to initialCheck for better troubleshooting
visibility.
This commit is contained in:
Stanislas
2025-12-12 23:47:09 +01:00
committed by GitHub
parent 179cbc0c25
commit 236e77af68

View File

@@ -234,13 +234,21 @@ function checkOS() {
} }
function initialCheck() { function initialCheck() {
log_debug "Checking root privileges..."
if ! isRoot; then if ! isRoot; then
log_fatal "Sorry, you need to run this script as root." log_fatal "Sorry, you need to run this script as root."
fi fi
log_debug "Root check passed"
log_debug "Checking TUN device availability..."
if ! tunAvailable; then if ! tunAvailable; then
log_fatal "TUN is not available." log_fatal "TUN is not available."
fi fi
log_debug "TUN device available at /dev/net/tun"
log_debug "Detecting operating system..."
checkOS checkOS
log_info "Detected OS: $OS (${PRETTY_NAME:-unknown})"
} }
# Check if OpenVPN version is at least the specified version # Check if OpenVPN version is at least the specified version