mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
clamav: Update init scripts
This replaces the use of uci_validate_section() with uci_load_validate(), which removes the need to declare local variables for every config option. This also removes some unnecessary curly brackets. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
This commit is contained in:
@@ -9,7 +9,7 @@ PROG=/usr/sbin/freshclam
|
||||
FRESHCLAM_CONFIGFILE="/tmp/clamav/freshclam.conf"
|
||||
|
||||
validate_freshclam_section() {
|
||||
uci_validate_section freshclam freshclam "${1}" \
|
||||
uci_load_validate freshclam freshclam "$1" "$2" \
|
||||
'freshclam_config_file:string' \
|
||||
'UpdateLogFile:string' \
|
||||
'DatabaseMirror:string' \
|
||||
@@ -19,11 +19,8 @@ validate_freshclam_section() {
|
||||
'DatabaseDirectory:string:'
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local freshclam_config_file UpdateLogFile DatabaseOwner NotifyClamd DatabaseMirror \
|
||||
DatabaseDirectory
|
||||
|
||||
validate_freshclam_section freshclam || {
|
||||
start_freshclam_instance() {
|
||||
[ "$2" = 0 ] || {
|
||||
echo "validation failed"
|
||||
return 1
|
||||
}
|
||||
@@ -51,6 +48,11 @@ start_service() {
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
start_service()
|
||||
{
|
||||
validate_freshclam_section freshclam start_freshclam_instance
|
||||
}
|
||||
|
||||
stop_service()
|
||||
{
|
||||
[ ! -f /tmp/freshclam.pid ] && echo "not running" && return 0
|
||||
|
||||
Reference in New Issue
Block a user