scripts dutchification - batch 2

This commit is contained in:
bergware
2023-10-04 19:32:06 +02:00
parent e738565d54
commit e374ab4aaf
10 changed files with 24 additions and 7 deletions

View File

@@ -14,6 +14,7 @@ DAEMON="ACPI daemon"
acpid_start(){
log "Starting $DAEMON..."
local REPLY
if [[ -x /usr/sbin/acpid && -d /proc/acpi ]]; then
run /usr/sbin/acpid
REPLY="Started"

View File

@@ -24,6 +24,7 @@ atd_running(){
atd_start(){
log "Starting $DAEMON..."
local REPLY
if atd_running; then
REPLY="Already started"
else
@@ -35,6 +36,7 @@ atd_start(){
atd_stop(){
log "Stopping $DAEMON..."
local REPLY
if ! atd_running; then
REPLY="Already stopped"
else

View File

@@ -35,6 +35,7 @@ avahidns_running(){
avahidns_start(){
log "Starting $DAEMON..."
local REPLY
if avahidns_running; then
REPLY="Already started"
else
@@ -46,6 +47,7 @@ avahidns_start(){
avahidns_stop(){
log "Stopping $DAEMON..."
local REPLY
if ! avahidns_running; then
REPLY="Already stopped"
else

View File

@@ -23,6 +23,7 @@ crond_running(){
crond_start(){
log "Starting $DAEMON..."
local REPLY
if crond_running; then
REPLY="Already started"
else
@@ -35,6 +36,7 @@ crond_start(){
crond_stop(){
log "Stopping $DAEMON..."
local REPLY
if ! crond_running; then
REPLY="Already stopped"
else

View File

@@ -19,6 +19,7 @@ dnsmasq_running(){
dnsmasq_start(){
log "Starting $DAEMON..."
local REPLY
if [[ -x /usr/sbin/dnsmasq ]]; then
run /usr/sbin/dnsmasq
if dnsmasq_running; then REPLY="Started"; else REPLY="Failed"; fi
@@ -30,6 +31,7 @@ dnsmasq_start(){
dnsmasq_stop(){
log "Stopping $DAEMON..."
local REPLY
if dnsmasq_running; then
# try to use the .pid file first
pkill -F $PIDFILE 2>/dev/null

View File

@@ -33,6 +33,7 @@ elogind_running(){
elogind_start(){
log "Starting $DAEMON..."
local REPLY
[[ -x $ELOGIND ]] || exit 1
[[ -d /run/user ]] || mkdir -p /run/user
if [[ ! -d /run/systemd ]]; then
@@ -53,6 +54,7 @@ elogind_start(){
elogind_stop(){
log "Stopping $DAEMON..."
local REPLY
if ! elogind_running; then
REPLY="Already stopped"
else

View File

@@ -44,6 +44,7 @@ mcelog_running(){
mcelog_start(){
log "Starting $DAEMON..."
local REPLY
if [[ $MCELOG_MODE == daemon ]]; then
# ignorance is bliss I guess
$MCELOG --is-cpu-supported &>/dev/null
@@ -60,6 +61,7 @@ mcelog_start(){
mcelog_stop(){
log "Stopping $DAEMON..."
local REPLY
if [[ $MCELOG_MODE == daemon ]]; then
killall -TERM $MCELOG
if ! mcelog_running; then REPLY="Stopped"; else REPLY="Failed"; fi

View File

@@ -28,6 +28,7 @@ dbus_running(){
dbus_start(){
log "Starting $DAEMON..."
local REPLY
if dbus_running; then
REPLY="Already started"
else
@@ -44,6 +45,7 @@ dbus_start(){
dbus_stop(){
log "Stopping $DAEMON..."
local REPLY
if ! dbus_running; then
REPLY="Already stopped"
else

View File

@@ -29,24 +29,24 @@ php_fpm_waitfor(){
while $TIMER -gt 0; do
case "$1" in
'created')
[[ -f $2 ]] && return
[[ -f $2 ]] && return 0
;;
'removed')
[[ -f $2 ]] || return
[[ -f $2 ]] || return 0
;;
esac
((TIMER--))
sleep 1
done
REPLY="Failed"
return 1
}
php_fpm_start(){
log "Starting $DAEMON..."
local REPLY
$PHP_FPM_BIN --daemonize $PHP_OPTS
if [[ $? -eq 0 ]]; then
php_fpm_waitfor created $PHP_FPM_PID
REPLY="Started"
if php_fpm_waitfor created $PHP_FPM_PID; then REPLY="Started"; else REPLY="Failed"; fi
else
REPLY="Already started"
fi
@@ -55,10 +55,10 @@ php_fpm_start(){
php_fpm_stop(){
log "Stopping $DAEMON..."
local REPLY
if [[ -r $PHP_FPM_PID ]]; then
kill -QUIT $(cat $PHP_FPM_PID)
php_fpm_waitfor removed $PHP_FPM_PID
REPLY="Stopped"
if php_fpm_waitfor removed $PHP_FPM_PID; then REPLY="Stopped"; else REPLY="Failed"; fi
else
REPLY="Already stopped"
fi

View File

@@ -33,6 +33,7 @@ wsdd2_running(){
wsdd2_start(){
log "Starting $DAEMON..."
local REPLY
if [[ -r /etc/samba/smb.conf && -x /etc/rc.d/rc.samba && -x /usr/sbin/wsdd2 ]]; then
if wsdd2_running; then
REPLY="Already started"
@@ -51,6 +52,7 @@ wsdd2_start(){
wsdd2_stop(){
log "Stopping $DAEMON..."
local REPLY
# check something is running before trying to kill it.
if ! wsdd2_running; then
REPLY="Already stopped"