source: trunk/debathena/config/auto-update/debian/debathena-auto-update.init @ 25859

Revision 25859, 1.2 KB checked in by jdreed, 11 years ago (diff)
In auto-update: * Actually, don't bother cleaning up the headers by hand. Instead, just auto-remove packages (unless that would remove metapackages) for compatibility with old aptitude-based updater. (Trac: #1012) * Convert from CDBS to dh7 and build-dep on dh 7.0.50 * Update copyright file to format 1.0 and re-license under BSD 3-clause * Bump Standards-Version to 3.9.3 * Remove unneeded dependency on bsdutils (it's required) * Add $remote_fs dependency in init script because it's apparently still 1992 and /usr might be an NFS mount
Line 
1#!/bin/sh
2#
3### BEGIN INIT INFO
4# Provides:          debathena-auto-update
5# Required-Start:    $network $local_fs $remote_fs
6# Required-Stop:     $network $local_fs $remote_fs
7# Default-Start:     2 3 4 5
8# Default-Stop:      0 1 6
9# Short-Description: Run an update at boot time
10# Description:       Run an update at boot time
11### END INIT INFO
12#
13# This script is part of the debathena-auto-update package
14# See /usr/share/doc/debathena-auto-update/copyright
15
16machtype -v -L | grep -q "debathena-cluster" || exit 0
17
18. /lib/lsb/init-functions
19
20case "$1" in
21start)
22        if [ -f /var/lib/athena-update-status ]; then
23            updlast=$(awk -F\| '{print $2;}' /var/lib/athena-update-status)
24            time=$(date +%s)
25            if echo $updlast | grep -q ^[0-9]*$; then
26                elapsed=`echo $time - $updlast | bc`
27                if [ $elapsed -lt 86400 ]; then
28                    exit 0
29                fi
30            fi
31        fi
32        log_action_msg "Workstation has not checked for an update in 24 hours"
33        log_action_msg "Forcing an update now (this can take up to 15 minutes)"
34        if /usr/sbin/athena-auto-update; then
35            log_end_msg 0
36        else
37            log_end_msg 1
38        fi
39        ;;
40stop|restart|reload|force-reload|status)
41        exit 0
42        ;;
43*)
44        log_action_msg "Usage: /etc/init.d/debathena-auto-update {start}"
45        exit 1
46        ;;
47esac
48exit 0
Note: See TracBrowser for help on using the repository browser.