Your message dated Sat, 21 Apr 2018 06:41:53 +1200
with message-id <[email protected]>
and subject line squidclient: an example init.d script to control offline_mode
has caused the Debian Bug report #153712,
regarding squidclient: an example init.d script to control offline_mode
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
153712: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=153712
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: squidclient
Version: 2.4.7-1
Severity: wishlist
Tags: patch

Hello,

The following is a script, suitable for /etc/init.d, for putting squid
online (on "start") and offline (on "stop").  I think squid users with
intermittent network connections might find this script useful.

#!/bin/sh
#
# Adjust squid mode between online and offline.
# [ccshan 2002-07-20]

PATH=/bin:/usr/bin
CLIENT=/usr/bin/squidclient

test -f "$CLIENT" || exit 0

invoke_cachemgr () {
  if result="`"$CLIENT" "mgr:$1" 2>/dev/null`"; then
    :
  else
    sleep 5
    if result="`"$CLIENT" "mgr:$1"`"; then
      :
    else
      exit 1
    fi
  fi
}

is_offline () {
  invoke_cachemgr config
  echo "$result" | grep -q "^offline_mode on$"
}

toggle_offline () {
  invoke_cachemgr offline_toggle
  result="`echo "$result" | grep "^offline_mode is now "`"
  echo -E "$result."
}

case "$1" in
start|restart|force-reload)
  echo -n "Putting squid online: "
  if is_offline; then
    toggle_offline
  else
    echo "offline_mode is already off."
  fi
  ;;
stop)
  echo -n "Putting squid offline: "
  if is_offline; then
    echo "offline_mode is already on."
  else
    toggle_offline
  fi
  ;;
*)
  echo "Usage: /etc/init.d/squid-mode {start|stop|restart|force-reload}"
  exit 1
esac

exit 0

-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux proper 2.4.18 #1 Sun Jun 16 22:31:58 CST 2002 i686
Locale: LANG=C, LC_CTYPE=en_US

Versions of packages squidclient depends on:
ii  libc6                         2.2.5-12   GNU C Library: Shared libraries an

-- no debconf information



--- End Message ---
--- Begin Message ---
Closing this because squidclient *is* the command to control offline
mode, and an mentioned earlier it does not do what most people think.

The squid packages are also moving to systemd init for which init
control of this mode is not possible.


Amos

--- End Message ---

Reply via email to