File: wtmpdb.wtmpdb-update-boot.init

package info (click to toggle)
wtmpdb 0.73.0-3
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 556 kB
  • sloc: ansic: 4,180; xml: 697; sh: 58; makefile: 15
file content (45 lines) | stat: -rw-r--r-- 1,221 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#! /bin/sh
#
# Thanks to:
#   Mark Hindley
#   Lorenzo Puliti
#
# Originally generated by /home/mark/src/debian/unit-translator/utrans from:
#  6e6aacdeddf878a01b260abbda787373e176cce440d786d535d6cf7a465c25cd
#  +./tmp.iH71YBzenr/usr/lib/systemd/system/wtmpdb-update-boot.service

# kFreeBSD does not accept scripts as interpreters, using #!/bin/sh and sourcing.
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
   set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
fi

### BEGIN INIT INFO
# Provides:          wtmpdb-update-boot
# Required-Start:    $remote_fs
# Required-Stop:     $remote_fs
# Should-Start:
# Should-Stop:
# Default-Start:     S
# Default-Stop:      0 6
# Short-Description: Write boot and shutdown times into wtmpdb
# Description:       Invokes wtmpdb to write boot and shutdown times
#                    into the wtmpdb login database.
### END INIT INFO

DESC="Write boot and shutdown times into wtmpdb"
DAEMON="none"
NAME="wtmpdb-update-boot"

do_start_cmd_override() {
  if [ "$RUNLEVEL" = "S" ] && [ "$PREVLEVEL" = "N" ]
  then
    /usr/bin/wtmpdb boot
  fi
}

do_stop_cmd_override() {
  if [ "$RUNLEVEL" = "0" ] || [ "$RUNLEVEL" = "6" ]
  then
    /usr/bin/wtmpdb shutdown
  fi
}