mirror of
https://github.com/rightup/pyMC_Repeater.git
synced 2026-03-28 17:43:06 +01:00
Add enabled check for when pymc_repeater is installed by default but not enabled (femtofox)
This commit is contained in:
@@ -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."
|
||||
|
||||
Reference in New Issue
Block a user