diff --git a/manage.sh b/manage.sh index ec61e9d..a95a546 100755 --- a/manage.sh +++ b/manage.sh @@ -70,6 +70,11 @@ is_running() { systemctl is-active "$SERVICE_NAME" >/dev/null 2>&1 } +# Function to check if service is enabled +is_enabled() { + systemctl is-enabled "$SERVICE_NAME" >/dev/null 2>&1 +} + # Function to get current version get_version() { # Try to read from _version.py first (generated by setuptools_scm) @@ -638,6 +643,9 @@ manage_service() { case $action in "start") + if ! is_enabled; then + systemctl enable "$SERVICE_NAME" + fi systemctl start "$SERVICE_NAME" if is_running; then show_info "Service Started" "\n✓ pyMC Repeater service has been started successfully."