mirror of
https://github.com/openwrt/packages.git
synced 2025-12-21 23:34:31 +04:00
net/squid: Allow squid to parse mime.conf
Copy mime.conf to temporary directory so squid process can properly read the file. Without it squid cannot access mime.conf and throws a warning during startup. Signed-off by: Adam Gensler <openwrt@a.gnslr.us>
This commit is contained in:
committed by
Zoltan HERPAI
parent
92fa2b3895
commit
3e972a57c6
@@ -3,3 +3,7 @@ config squid 'squid'
|
|||||||
option http_port '3128'
|
option http_port '3128'
|
||||||
option coredump_dir '/tmp/squid'
|
option coredump_dir '/tmp/squid'
|
||||||
option visible_hostname 'OpenWrt'
|
option visible_hostname 'OpenWrt'
|
||||||
|
option mime_table '/etc/squid/mime.conf'
|
||||||
|
#option http_port_options 'intercept'
|
||||||
|
#option ssldb '/tmp/squid/ssldb'
|
||||||
|
#option ssldb_options '-M 4MB'
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ STOP=10
|
|||||||
USE_PROCD=1
|
USE_PROCD=1
|
||||||
PROG=/usr/sbin/squid
|
PROG=/usr/sbin/squid
|
||||||
CONFIGFILE="/tmp/squid/squid.conf"
|
CONFIGFILE="/tmp/squid/squid.conf"
|
||||||
|
MIMETABLE="/tmp/squid/mime.conf"
|
||||||
|
|
||||||
validate_squid_section() {
|
validate_squid_section() {
|
||||||
uci_validate_section squid squid "${1}" \
|
uci_validate_section squid squid "${1}" \
|
||||||
@@ -14,7 +15,8 @@ validate_squid_section() {
|
|||||||
'http_port:port:3128' \
|
'http_port:port:3128' \
|
||||||
'coredump_dir:string' \
|
'coredump_dir:string' \
|
||||||
'visible_hostname:string:OpenWrt' \
|
'visible_hostname:string:OpenWrt' \
|
||||||
'pinger_enable:string:off'
|
'pinger_enable:string:off' \
|
||||||
|
'mime_table:string:/etc/squid/mime.conf'
|
||||||
}
|
}
|
||||||
|
|
||||||
start_service() {
|
start_service() {
|
||||||
@@ -33,6 +35,9 @@ start_service() {
|
|||||||
echo visible_hostname $visible_hostname >> $CONFIGFILE
|
echo visible_hostname $visible_hostname >> $CONFIGFILE
|
||||||
echo pinger_enable $pinger_enable >> $CONFIGFILE
|
echo pinger_enable $pinger_enable >> $CONFIGFILE
|
||||||
|
|
||||||
|
cat $mime_table > $MIMETABLE
|
||||||
|
echo mime_table $MIMETABLE >> $CONFIGFILE
|
||||||
|
|
||||||
procd_open_instance
|
procd_open_instance
|
||||||
procd_set_param command $PROG -s -f $CONFIGFILE -N
|
procd_set_param command $PROG -s -f $CONFIGFILE -N
|
||||||
procd_set_param file $CONFIGFILE
|
procd_set_param file $CONFIGFILE
|
||||||
|
|||||||
Reference in New Issue
Block a user