mirror of
https://github.com/openwrt/packages.git
synced 2025-12-26 13:26:17 +04:00
Merge pull request #3794 from adam2104/master
net/squid: Allow squid to parse mime.conf
This commit is contained in:
@@ -3,6 +3,7 @@ config squid 'squid'
|
||||
option http_port '3128'
|
||||
option coredump_dir '/tmp/squid'
|
||||
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
|
||||
PROG=/usr/sbin/squid
|
||||
CONFIGFILE="/tmp/squid/squid.conf"
|
||||
MIMETABLE="/tmp/squid/mime.conf"
|
||||
|
||||
validate_squid_section() {
|
||||
uci_validate_section squid squid "${1}" \
|
||||
@@ -17,7 +18,8 @@ validate_squid_section() {
|
||||
'ssldb_options:string' \
|
||||
'coredump_dir:string' \
|
||||
'visible_hostname:string:OpenWrt' \
|
||||
'pinger_enable:string:off'
|
||||
'pinger_enable:string:off' \
|
||||
'mime_table:string:/etc/squid/mime.conf'
|
||||
}
|
||||
|
||||
start_service() {
|
||||
@@ -38,6 +40,8 @@ start_service() {
|
||||
echo coredump_dir $coredump_dir >> $CONFIGFILE
|
||||
echo visible_hostname $visible_hostname >> $CONFIGFILE
|
||||
echo pinger_enable $pinger_enable >> $CONFIGFILE
|
||||
cat $mime_table > $MIMETABLE
|
||||
echo mime_table $MIMETABLE >> $CONFIGFILE
|
||||
[ "$ssldb" ] && echo sslcrtd_program /usr/lib/squid/ssl_crtd -s $ssldb $ssldb_options >> $CONFIGFILE
|
||||
$PROG -s -f $CONFIGFILE -N -z 2>/dev/null
|
||||
|
||||
|
||||
Reference in New Issue
Block a user