add restart redis, use if properly
This commit is contained in:
parent
4315bfbcab
commit
a95e3cd8f5
17
emailwiz
17
emailwiz
|
@ -433,10 +433,19 @@ doas -u _dkimsign openssl genrsa -out "${dkimkey}" 2048
|
||||||
#
|
#
|
||||||
|
|
||||||
for x in 'smtpd' 'dovecot' 'rspamd' 'redis'; do
|
for x in 'smtpd' 'dovecot' 'rspamd' 'redis'; do
|
||||||
printf '%s: Enabling %s...' "${progname}" "${x}"
|
printf '%s: Enabling %s...' "${progname}" "$x"
|
||||||
rcctl enable "${x}" 2>&1 > /dev/null && printf ' Done\n' || printf ' Failed\n'
|
if rcctl enable "$x" 2>&1 > /dev/null; then
|
||||||
printf '%s: Restarting %s...' "${progname}" "${x}"
|
printf ' Done\n'
|
||||||
rcctl restart "${x}" 2>&1 > /dev/null && printf ' Done\n' || printf ' Failed\n'
|
else
|
||||||
|
printf ' Failed\n'
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf '%s: Restarting %s...' "${progname}" "$x"
|
||||||
|
if rcctl restart "$x" 2>&1 > /dev/null; then
|
||||||
|
printf ' Done\n'
|
||||||
|
else
|
||||||
|
printf ' Failed\n'
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
12
mailrestart
12
mailrestart
|
@ -14,9 +14,11 @@ if test "$(id -u)" != '0'; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for x in 'smtpd' 'dovecot' 'rspamd'; do
|
for x in 'smtpd' 'dovecot' 'rspamd' 'redis'; do
|
||||||
printf '%s: Restarting %s...' "${progname}" "${x}"
|
printf '%s: Restarting %s...' "${progname}" "$x"
|
||||||
rcctl restart "${x}" 2>&1 > /dev/null \
|
if rcctl restart "$x" 2>&1 > /dev/null; then
|
||||||
&& printf ' Done\n' \
|
printf ' Done\n'
|
||||||
|| printf ' Failed\n'
|
else
|
||||||
|
printf ' Failed\n'
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue