Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Название темы: SQUID
Показать сообщение отдельно

Пользователь


Сообщения: 86
Благодарности: 0

Профиль | Отправить PM | Цитировать


# squid - SQUID HTTP proxy-cache
#

description "HTTP proxy-cache"
author "Chuck Short <zulcss@ubuntu.com>"

start on runlevel [2345] or net-device-up IFACE!=lo
stop on runlevel [!2345]

# Disable DNS checks so we can start squid
# before a "real" network is available.
env SQUID_ARGS="-D"

pre-start script
if [ -f /etc/default/squid ]; then
. /etc/default/squid
fi


grepconf () {
w=" " # space tab
sq=/etc/squid/squid.conf
# sed is cool.
res=`sed -ne '
s/^'$1'['"$w"']\+\([^'"$w"']\+\).*$/\1/p;
t end;
d;
:end q' < $sq`
[ -n "$res" ] || res=$2
echo "$res"
}

grepconf2 () {
w=" " # space tab
sq=/etc/squid/squid.conf
# sed is cool.
res=`sed -ne '
s/^'$1'['"$w"']\+[^'"$w"']\+['"$w"']\+\([^'"$w"']\+\).*$/\1/p;
t end;
d;
:end q' < $sq`
[ -n "$res" ] || res=$2
echo "$res"
}

cdr=`grepconf2 cache_dir /var/spool/squid`
ctp=`grepconf cache_dir ufs`

case "$cdr" in
[0-9]*)
echo "squid: squid.conf contains 2.2.5 syntax - not starting"
exit 1 ; stop
;;
esac

if [ -d "$cdr" -a ! -d "$cdr/00" ] || [ "$ctp" = "coss" -a ! -w "$cdr" ]
then
/usr/sbin/squid $SQUID_ARGS -z
fi

end script

script
if [ -f /etc/default/squid ]; then
. /etc/default/squid
fi

exec /usr/sbin/squid -N $SQUID_ARGS
end script

Отправлено: 09:20, 13-11-2012 | #3

Название темы: SQUID