]> git.pld-linux.org Git - packages/apparmor-parser.git/blob - apparmor-parser.init
- a bit better but still doesn't match pld style
[packages/apparmor-parser.git] / apparmor-parser.init
1 #!/bin/bash
2 # chkconfig: 2345 01 99
3 # description: AppArmor rc file. This rc script inserts the apparmor \
4 #              module and runs the parser on the /etc/apparmor.d/ \
5 #              directory.
6 #
7
8 # Source function library
9 . /etc/rc.d/init.d/functions
10
11 aa_log_skipped_msg() {
12         busy
13         fail
14         [ -n "$*" ] && echo "$*"
15 }
16 aa_log_success_msg() {
17         busy
18         ok
19         [ -n "$*" ] && echo "$*"
20 }
21
22 aa_log_warning_msg() {
23         busy
24         fail
25         [ -n "$*" ] && echo "$*"
26 }
27
28 aa_log_failure_msg() {
29         busy
30         fail
31         [ -n "$*" ] && echo "$*"
32 }
33
34 aa_action() {
35         STRING=$1
36         shift
37         run_cmd "$STRING" "$@"
38         return $?
39 }
40
41 . /etc/apparmor/rc.apparmor.functions
42
43 RETVAL=0
44 case "$1" in
45 start)
46         msg_starting apparmor
47         started
48         apparmor_start
49         ;;
50 stop)
51         msg_stopping apparmor
52         started
53         apparmor_stop
54         ;;
55 restart|reload|force-reload)
56         msg_reloading apparmor
57         started
58         apparmor_restart
59         ;;
60 try-restart)
61         msg_reloading
62         started
63         apparmor_try_restart
64         ;;
65 debug)
66         apparmor_debug
67         ;;
68 kill)
69         apparmor_kill
70         ;;
71 status)
72         apparmor_status
73         ;;
74 *)
75         msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status|kill}"
76         exit 3
77 esac
78
79 exit $RETVAL
This page took 0.05637 seconds and 4 git commands to generate.