Merge pull request #8103 from jefferyto/e2guardian-init

e2guardian: Update init script
This commit is contained in:
Rosen Penev 2019-03-31 20:29:31 -07:00 committed by GitHub
commit 40e289c596
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 17 deletions

View file

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=e2guardian PKG_NAME:=e2guardian
PKG_VERSION:=3.2.0 PKG_VERSION:=3.2.0
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_LICENSE:=GPL-2.0 PKG_LICENSE:=GPL-2.0
PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org> PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org>

View file

@ -11,7 +11,7 @@ LOGFILE="/tmp/e2guardian/access.log"
GROUPCONFIG="/tmp/e2guardian/e2guardianf1.conf" GROUPCONFIG="/tmp/e2guardian/e2guardianf1.conf"
validate_e2guardian_section() { validate_e2guardian_section() {
uci_validate_section e2guardian e2guardian "${1}" \ uci_load_validate e2guardian e2guardian "$1" "$2" \
'accessdeniedaddress:string' \ 'accessdeniedaddress:string' \
'bannediplist:string' \ 'bannediplist:string' \
'contentscanexceptions:string' \ 'contentscanexceptions:string' \
@ -83,22 +83,9 @@ validate_e2guardian_section() {
'weightedphrasemode:range(0,2)' 'weightedphrasemode:range(0,2)'
} }
start_service() { start_e2guardian_instance() {
local accessdeniedaddress bannediplist contentscanexceptions contentscanner contentscannertimeout \ [ "$2" = 0 ] || {
createlistcachefiles custombannedflashfile custombannedimagefile deletedownloadedtempfiles \
downloadmanager exceptioniplist filecachedir loglocation \
filtergroups filtergroupslist filterip filterports forcequicksearch forwardedfor hexdecodecontent \
initialtrickledelay ipcfilename ipipcfilename language languagedir logadblocks logchildprocesshandling \
logclienthostnames logconnectionhandlingerrors logexceptionhits logfileformat loglevel loguseragent \
maxagechildren maxchildren maxcontentfilecachescansize maxcontentfiltersize maxcontentramcachescansize \
maxips maxsparechildren maxuploadsize minchildren minsparechildren nodaemon nologger \
pcontimeout perroomdirectory phrasefiltermode prefercachedlists preforkchildren preservecase proxyexchange \
proxyip proxyport proxytimeout recheckreplacedurls reverseaddresslookups reverseclientiplookups scancleancache \
showweightedfound softrestart trickledelay urlcacheage urlcachenumber urlipcfilename usecustombannedflash \
usecustombannedimage usexforwardedfor weightedphrasemode
validate_e2guardian_section e2guardian || {
echo "validation failed" echo "validation failed"
return 1 return 1
} }
@ -198,6 +185,11 @@ start_service() {
} }
start_service()
{
validate_e2guardian_section e2guardian start_e2guardian_instance
}
stop_service() stop_service()
{ {
PID=`cat /tmp/e2guardian/e2guardian.pid` PID=`cat /tmp/e2guardian/e2guardian.pid`