Re: Zwingen ein Paket zu deinstallieren
Andreas Metzler wrote:
> Nur damit ich richtig verstehe
> netstat -rn |awk '/^0\.0\.0\.0 / {print $8}' ; echo $?
> liefert mit "deinem" awk einen Fehler, mit gawk funktioniert es aber:
> netstat -rn | gawk '/^0\.0\.0\.0 / {print $8}' ; echo $?
>
> Was hast du denn fuer ein awk verwendet?
>
> Genuegt installieren von gawk und setzen desselben als default-awk?
> update-alternatives --config awk
Jetzt habe ich folgende Ausgabe:
[11:55pm]root@skyliner:[/home/tchino/]
command1$ DEBIAN_SCRIPT_DEBUG=1 /etc/init.d/wwwoffle stop
/etc/init.d/wwwoffle: 1: command not found
PATH=/sbin:/bin:/usr/sbin:/usr/bin
+ PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=wwwoffled
+ NAME=wwwoffled
PROGRAM=/usr/bin/wwwoffle
+ PROGRAM=/usr/bin/wwwoffle
DAEMON=/usr/sbin/$NAME
+ DAEMON=/usr/sbin/wwwoffled
CONFIG=/etc/wwwoffle/wwwoffle.conf
+ CONFIG=/etc/wwwoffle/wwwoffle.conf
test -f $DAEMON || exit 0
+ test -f /usr/sbin/wwwoffled
if grep -qsx ppp /etc/wwwoffle/wwwoffle.options; then
# a whole lot of logic to determine what mode wwwoffle should run in...
mode=offline
# ISDN and diald can be in autodial mode
# find default route
WWWOFFLEDEFROUTEIF=`netstat -rn | awk '/^0\.0\.0\.0 / {print $8}'`
if [ `expr "$WWWOFFLEDEFROUTEIF" : i` -eq 1 ]; then # default route via
ISDN
if isdnctrl dialmode $WWWOFFLEDEFROUTEIF 2>/dev/null |
grep auto >/dev/null; then
# ISDN interface is in autodial mode
mode=autodial
elif isdnctrl status $WWWOFFLEDEFROUTEIF >/dev/null 2>&1; then
mode=online
fi
elif ps ax | grep '[/]usr/sbin/diald' >/dev/null; then
# diald is running, hence also autodial
mode=autodial
elif ps ax | egrep '[/]usr/sbin/pp(tp|poe)' >/dev/null; then
# pptp or pppoe is running (for ADSL), hence always online
mode=online
fi
else
# wwwoffle not configured to go over dialup, so assume online
mode=online
fi
+ grep -qsx ppp /etc/wwwoffle/wwwoffle.options
+ mode=offline
netstat -rn | awk '/^0\.0\.0\.0 / {print $8}'
++ netstat -rn
++ awk '/^0\.0\.0\.0 / {print $8}'
+ WWWOFFLEDEFROUTEIF=ippp0
expr "$WWWOFFLEDEFROUTEIF" : i
++ expr ippp0 : i
+ '[' 1 -eq 1 ']'
+ isdnctrl dialmode ippp0
+ grep auto
+ isdnctrl status ippp0
case "$1" in
start)
echo -n "Starting HTTP cache proxy server: "
# Check if the cache dir is intact. According to the Debian Policy
# the cache dir may be deleted and has to recreate itself
automatically.
install -d -D -o proxy -g proxy \
/var/cache/wwwoffle/http \
/var/cache/wwwoffle/lastout \
/var/cache/wwwoffle/lasttime \
/var/cache/wwwoffle/local \
/var/cache/wwwoffle/outgoing \
/var/cache/wwwoffle/prevtime1 \
/var/cache/wwwoffle/finger \
/var/cache/wwwoffle/ftp \
/var/cache/wwwoffle/search/htdig/db \
/var/cache/wwwoffle/search/htdig/db-lasttime \
/var/cache/wwwoffle/search/htdig/tmp \
/var/cache/wwwoffle/search/mnogosearch/db \
/var/cache/wwwoffle/search/namazu/db
msg=" in /var/cache/wwwoffle/search"
for i in htdig mnogosearch namazu; do
if [ ! -L /var/cache/wwwoffle/search/$i/conf ]; then
echo "restoring $i/conf symlink$msg"; msg=''
rm -f /var/cache/wwwoffle/search/$i/conf
ln -s /etc/wwwoffle/$i /var/cache/wwwoffle/search/$i/conf
fi
if [ ! -L /var/cache/wwwoffle/search/$i/scripts ]; then
echo "restoring $i/scripts symlink$msg"; msg=''
rm -f /var/cache/wwwoffle/search/$i/scripts
ln -s /usr/share/wwwoffle/search/$i
/var/cache/wwwoffle/search/$i/scripts
fi
done
if [ ! -L /var/cache/wwwoffle/html ]; then
if [ -e /var/cache/wwwoffle/html ]; then
mv -f /var/cache/wwwoffle/html
/var/cache/wwwoffle/html.x
fi
ln -sf /usr/share/wwwoffle/html /var/cache/wwwoffle/html
fi
if [ ! -L /var/cache/wwwoffle/monitor ]; then
if [ -d /var/cache/wwwoffle/monitor ]; then
(
echo " moving /var/cache/wwwoffle/monitor to
/var/lib/wwwoffle/monitor"
cd /var/cache/wwwoffle/monitor;
mv * /var/lib/wwwoffle/monitor 2>/dev/null || true
)
fi
rm -rf /var/cache/wwwoffle/monitor
echo " creating /var/cache/wwwoffle/monitor symlink"
ln -sf ../../lib/wwwoffle/monitor /var/cache/wwwoffle/monitor
fi
TEMPFILE=`tempfile -p WWWOFFLE`
set +e
start-stop-daemon --start --exec $DAEMON -- -c $CONFIG >$TEMPFILE
2>&1
RC=$?
fgrep -v 'Important: WWWOFFLE Demon Version
Information: WWWOFFLE Read Configuration File
Information: Running with uid=' $TEMPFILE
rm -f $TEMPFILE
set -e
if [ $RC -eq 0 ]; then
if [ "$mode" = "offline" ]; then
echo "(offline mode) done."
else
$PROGRAM -c $CONFIG -$mode
fi
else
echo "...failed."
fi
if grep -qsx nocheckconf /etc/wwwoffle/wwwoffle.options; then
if grep '^[^#]*://.*/$' $CONFIG; then
printf '\a'
cat << 'EOF'
sleep 6
fi
fi
;;
stop)
echo -n "Stopping HTTP cache proxy server: $NAME"
if start-stop-daemon --stop --quiet --exec $DAEMON; then
echo "."
else
echo "...failed."
fi
;;
force-restart|restart|force-reload)
# The wwwoffled maybe was already online.
if ps acx | grep 'w[w]woffled' >/dev/null; then
if wwwoffle -status -c $CONFIG | grep -qs online; then
newmode=online
elif wwwoffle -status -c $CONFIG | grep -qs offline; then
newmode=offline
else
newmode=autodial # lucky guess?
fi
fi
$0 stop
$0 start
# if wwwoffle wasn't in the default startup mode, change it
if [ "$newmode" != "$mode" ]; then
$PROGRAM -c $CONFIG -$newmode
fi
;;
reload)
echo -n "Reloading $NAME configuration files..."
if start-stop-daemon --stop --signal 1 --quiet --exec $DAEMON; then
echo "done."
else
echo "failed."
fi
;;
*)
echo "Usage: /etc/init.d/$NAME
{start|stop|reload|restart|force-restart|force-reload}"
exit 1
;;
esac
+ echo -n 'Stopping HTTP cache proxy server: wwwoffled'
Stopping HTTP cache proxy server: wwwoffled+ start-stop-daemon --stop
--quiet --exec /usr/sbin/wwwoffled
+ echo ...failed.
...failed.
exit 0
+ exit 0
Kannst du jetzt damit etwas anfangen? ich habe fürawk gawk als default
eingetragen.
Gruß Thomas
Reply to: