Fix(upgrade): Improve scheduler setup
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
setup_hysteria_scheduler() {
|
||||
echo "Setting up Hysteria scheduler service..."
|
||||
|
||||
chmod +x /etc/hysteria/core/scripts/scheduler.py
|
||||
|
||||
@ -31,15 +30,11 @@ EOF
|
||||
|
||||
(crontab -l | grep -v "hysteria2_venv.*traffic-status" | grep -v "hysteria2_venv.*backup-hysteria") | crontab -
|
||||
|
||||
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."
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
@ -48,15 +43,13 @@ check_scheduler_service() {
|
||||
|
||||
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
|
||||
# if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
||||
# setup_hysteria_scheduler
|
||||
# verify_scheduler_service
|
||||
# fi
|
||||
@ -101,10 +101,6 @@ source "$HYSTERIA_INSTALL_DIR/core/scripts/scheduler.sh"
|
||||
if ! check_scheduler_service; then
|
||||
info "Installing Hysteria scheduler service..."
|
||||
setup_hysteria_scheduler
|
||||
|
||||
if ! verify_scheduler_service; then
|
||||
error "Warning: Scheduler service installation may have issues"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ========== Restart Services ==========
|
||||
|
||||
Reference in New Issue
Block a user