mirror of
https://github.com/thetechprepper/emcomm-tools-os-community.git
synced 2026-09-17 15:41:44 -04:00
55 lines
1.7 KiB
Bash
Executable File
55 lines
1.7 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Author : Gaston Gonzalez
|
|
# Date : 12 November 2024
|
|
# Updated : 16 July 2026
|
|
# Purpose : Stops all EmComm Tools soundcard-based services (i.e. modems)
|
|
# and radio applications to ensure a clean start for the next mode.
|
|
|
|
stop_pat() {
|
|
PS_OUT=$(ps -ef | grep "[p]at http")
|
|
|
|
if [[ $? -eq 0 ]]; then
|
|
PAT_PID=$(ps -ef | grep "[p]at http" | awk '{print $2}')
|
|
kill -9 ${PAT_PID}
|
|
fi
|
|
}
|
|
|
|
# 1. Attempt to stop all EmComm Tools services regardless if they are running.
|
|
# 2. Stop the applications first, then the modems.
|
|
stop_all_services() {
|
|
systemctl --user stop et-service-winlink-ardop
|
|
systemctl --user stop et-service-winlink-packet
|
|
systemctl --user stop et-service-winlink-native-packet
|
|
systemctl --user stop et-service-ardop
|
|
systemctl --user stop et-service-direwolf-300
|
|
systemctl --user stop et-service-direwolf-9600
|
|
systemctl --user stop et-service-direwolf-simple
|
|
systemctl --user stop et-service-direwolf-aprs-digipeater
|
|
systemctl --user stop et-service-direwolf-packet-digipeater
|
|
|
|
# Stop modem73 with a sledge hammer (belt and suspenders) as the current
|
|
# 1.0.7 version can hang on exit.
|
|
systemctl --user stop et-service-modem73-default
|
|
systemctl --user stop et-service-modem73-reliability
|
|
systemctl --user stop et-service-modem73-fast
|
|
systemctl --user stop et-service-modem73-faster
|
|
systemctl --user stop et-service-modem73-fastest
|
|
pkill -9 modem73
|
|
|
|
# Stop the Mercury HF modem
|
|
systemctl --user stop et-service-mercury-balanced
|
|
systemctl --user stop et-service-mercury-reliability
|
|
systemctl --user stop et-service-mercury-fast
|
|
|
|
# Stop VARA with a sledge hammer
|
|
pkill et-winlink
|
|
pkill et-vara
|
|
pkill VARA
|
|
|
|
stop_pat
|
|
}
|
|
|
|
et-log "Stopping all services"
|
|
stop_all_services
|