Add service verification to confirm successful installation

This commit is contained in:
Whispering Wind
2025-05-16 11:42:22 +03:30
committed by GitHub
parent 2e35c62c48
commit fe7fa3cd2d
2 changed files with 17 additions and 6 deletions

View File

@ -34,19 +34,29 @@ EOF
echo "Hysteria scheduler service has been installed and started."
echo "You can check the status with: systemctl status hysteria-scheduler"
echo "Logs are available at: journalctl -u hysteria-scheduler"
return 0
}
check_scheduler_service() {
if systemctl is-active --quiet hysteria-scheduler.service; then
# echo "Hysteria scheduler service is already active."
echo "Hysteria scheduler service is already active."
return 0
else
return 1
fi
}
verify_scheduler_service() {
if systemctl is-active --quiet hysteria-scheduler.service; then
echo "Verified: Hysteria scheduler service is running correctly."
return 0
else
echo "Error: Hysteria scheduler service failed to start properly."
return 1
fi
}
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
setup_hysteria_scheduler
verify_scheduler_service
fi