]>
Commit | Line | Data |
---|---|---|
990dad56 | 1 | #!/bin/sh |
2 | # $Id$ | |
3 | # | |
4 | # wine: Allow users to run Windows(tm) applications by just clicking | |
5 | # on them (or typing ./file.exe) | |
6 | # | |
7 | # chkconfig: 2345 99 10 | |
8 | # | |
9 | # description: Allow users to run Windows(tm) applications by just clicking | |
10 | # on them (or typing ./file.exe) | |
11 | # | |
12 | ||
13 | # Source function library | |
14 | . /etc/rc.d/init.d/functions | |
15 | ||
16e345b4 | 16 | BINFMT_DIR='/proc/sys/fs/binfmt_misc' |
17 | ||
990dad56 | 18 | case "$1" in |
19 | start) | |
16e345b4 | 20 | if [ -f /var/lock/subsys/wine ]; then |
21 | msg_already_running "Wine" | |
22 | else | |
23 | # check if binfmt_misc is not already mounted | |
24 | if ! /bin/mount | grep -q "${BINFMT_DIR} type binfmt_misc"; then | |
25 | /bin/mount none -t binfmt_misc /proc/sys/fs/binfmt_misc | |
26 | fi | |
27 | msg_starting "Wine" | |
28 | echo ':windows:M::MZ::/usr/X11R6/bin/wine:' > ${BINFMT_DIR}/register | |
29 | echo ':windowsPE:M::PE::/usr/X11R6/bin/wine:' > ${BINFMT_DIR}/register | |
30 | deltext | |
31 | ok | |
32 | fi | |
33 | touch /var/lock/subsys/wine | |
34 | ;; | |
990dad56 | 35 | stop) |
16e345b4 | 36 | if [ ! -f /var/lock/subsys/wine ]; then |
37 | msg_not_running "Wine" | |
38 | exit 0 | |
39 | fi | |
40 | msg_stopping "Wine" | |
41 | echo "-1" > ${BINFMT_DIR}/windows | |
42 | echo "-1" > ${BINFMT_DIR}/windowsPE | |
43 | rm -f /var/lock/subsys/wine | |
44 | deltext | |
45 | ok | |
46 | ;; | |
990dad56 | 47 | *) |
16e345b4 | 48 | echo "Usage: $0 {start|stop}" |
990dad56 | 49 | esac |