Debian Codegraph @

init/sysvinit/binfmt-support.in

raw
1 #! /bin/sh
2
3 # Copyright (C) 2002, 2005, 2009, 2010, 2014 Colin Watson.
4 #
5 # This file is part of binfmt-support.
6 #
7 # binfmt-support is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by the
9 # Free Software Foundation; either version 3 of the License, or (at your
10 # option) any later version.
11 #
12 # binfmt-support is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
15 # Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License along
18 # with binfmt-support; if not, write to the Free Software Foundation, Inc.,
19 # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
21 # This is a simple generic SysV init script. It may need adjustments for
22 # distribution policies, for example logging and LSB information.
23
24 NAME=binfmt-support
25 DESC="additional executable binary formats"
26
27 if [ "$(uname)" != Linux ]; then
28 exit 0
29 fi
30
31 test -x @sbindir@/update-binfmts || exit 0
32
33 set -e
34 CODE=0
35
36 case "$1" in
37 start)
38 echo -n "Enabling $DESC: "
39 @sbindir@/update-binfmts --enable || CODE=$?
40 echo "$NAME."
41 exit $CODE
42 ;;
43
44 stop)
45 echo -n "Disabling $DESC: "
46 @sbindir@/update-binfmts --disable || CODE=$?
47 echo "$NAME."
48 exit $CODE
49 ;;
50
51 restart|force-reload)
52 $0 stop
53 $0 start
54 ;;
55
56 *)
57 N=/etc/init.d/$NAME
58 echo "Usage: $N {start|stop|restart|force-reload}" >&2
59 exit 1
60 ;;
61 esac
62
63 exit 0