update
Some checks failed
It_School_001/pipeline/head Something is wrong with the build of this commit

This commit is contained in:
Ionel Andrei Cataon
2026-02-05 10:40:53 +02:00
parent 2d3f686918
commit f082bec56b
13 changed files with 228 additions and 5 deletions

14
Python_module_2/python_003.py Executable file
View File

@@ -0,0 +1,14 @@
#!/home/andrei/it_school/bin/python3
import sys
import subprocess
def check_service_status(service_name):
try:
# Run the systemctl command to check the service status
result = subprocess.run(['systemctl', 'is-active', service_name], capture_output=True, text=True)
return result.stdout.strip() == 'active'
except Exception as e:
print(f"Error checking service status: {e}")
return False