source: trunk/debathena/config/cluster-cups-config/debian/debathena-cluster-cups-config.init @ 25269

Revision 25269, 1.1 KB checked in by jdreed, 13 years ago (diff)
Abuse /var/run/athena-nologin to indicate that we're busy
Line 
1#! /bin/sh
2
3### BEGIN INIT INFO
4# Provides:          debathena-cluster-cups-config
5# Required-Start:    cups $remote_fs
6# Required-Stop:     cups $remote_fs
7# Should-Start:      $local_fs $network
8# Default-Start:     2 3 4 5
9# Default-Stop:      0 1 6
10# Short-Description: Cluster CUPS configuration
11# Description:       Ensure cluster printers exist
12### END INIT INFO
13
14. /lib/lsb/init-functions
15
16case "$1" in
17  start)
18    if [ -f /var/lib/debathena-cluster-cups-config-reconfigure_required ]; then
19      log_action_msg "Adding cluster printers"
20      nologin=0
21      if [ ! -f /var/run/athena-nologin ]; then
22        touch /var/run/athena-nologin
23        nologin=1
24      fi
25      if /usr/share/debathena-cluster-cups-config/configure-athena-printers add; then
26        rm -f /var/lib/debathena-cluster-cups-config-reconfigure_required
27        log_end_msg 0
28      else
29        log_end_msg 1
30      fi
31      [ $nologin -eq 1 ] && rm /var/run/athena-nologin
32    fi
33    ;;
34  stop|restart|reload|force-reload|status)
35    exit 0
36    ;;
37  *)
38    log_action_msg "Usage: /etc/init.d/debathena-cluster-cups-config {start}"
39    exit 1
40    ;;
41esac
42exit 0
Note: See TracBrowser for help on using the repository browser.