Merge pull request #8122 from jefferyto/squid-init
squid: Update init script
This commit is contained in:
commit
e4bb00d1b9
2 changed files with 11 additions and 6 deletions
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=squid
|
PKG_NAME:=squid
|
||||||
PKG_VERSION:=4.4
|
PKG_VERSION:=4.4
|
||||||
PKG_RELEASE:=2
|
PKG_RELEASE:=3
|
||||||
|
|
||||||
PKG_LICENSE:=GPL-2.0
|
PKG_LICENSE:=GPL-2.0
|
||||||
PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
|
PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
|
||||||
|
|
|
@ -10,7 +10,7 @@ CONFIGFILE="/tmp/squid/squid.conf"
|
||||||
MIMETABLE="/tmp/squid/mime.conf"
|
MIMETABLE="/tmp/squid/mime.conf"
|
||||||
|
|
||||||
validate_squid_section() {
|
validate_squid_section() {
|
||||||
uci_validate_section squid squid "${1}" \
|
uci_load_validate squid squid "$1" "$2" \
|
||||||
'config_file:string' \
|
'config_file:string' \
|
||||||
'http_port:port:3128' \
|
'http_port:port:3128' \
|
||||||
'http_port_options:string' \
|
'http_port_options:string' \
|
||||||
|
@ -27,10 +27,10 @@ create_squid_user() {
|
||||||
group_exists squid || group_add squid $USERID && group_add_user squid squid
|
group_exists squid || group_add squid $USERID && group_add_user squid squid
|
||||||
}
|
}
|
||||||
|
|
||||||
start_service() {
|
start_squid_instance() {
|
||||||
local config_file http_port http_port_options ssldb ssldb_options coredump_dir visible_hostname pinger_enable
|
local config_dir
|
||||||
|
|
||||||
validate_squid_section squid || {
|
[ "$2" = 0 ] || {
|
||||||
echo "validation failed"
|
echo "validation failed"
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
@ -57,9 +57,14 @@ start_service() {
|
||||||
procd_close_instance
|
procd_close_instance
|
||||||
}
|
}
|
||||||
|
|
||||||
|
start_service()
|
||||||
|
{
|
||||||
|
validate_squid_section squid start_squid_instance
|
||||||
|
}
|
||||||
|
|
||||||
stop_service()
|
stop_service()
|
||||||
{
|
{
|
||||||
${PROG} -f $CONFIGFILE -N -k shutdown 2>/dev/null
|
$PROG -f $CONFIGFILE -N -k shutdown 2>/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
service_triggers()
|
service_triggers()
|
||||||
|
|
Loading…
Reference in a new issue