]>
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 | # | |
83f130c5 | 7 | # chkconfig: 2345 95 10 |
990dad56 | 8 | # |
99e9afce | 9 | # description: Allow users to run Windows(tm) applications by just clicking \ |
990dad56 | 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 | ||
caa441d8 | 18 | |
990dad56 | 19 | case "$1" in |
989d349d | 20 | start|restart|reload|force-reload) |
caa441d8 | 21 | if [ ! -f /var/lock/subsys/wine ]; then |
16e345b4 | 22 | # check if binfmt_misc is not already mounted |
23 | if ! /bin/mount | grep -q "${BINFMT_DIR} type binfmt_misc"; then | |
24 | /bin/mount none -t binfmt_misc /proc/sys/fs/binfmt_misc | |
25 | fi | |
26 | msg_starting "Wine" | |
597d7dcd | 27 | echo ':windows:M::MZ::/usr/bin/wine:' > ${BINFMT_DIR}/register |
28 | echo ':windowsPE:M::PE::/usr/bin/wine:' > ${BINFMT_DIR}/register | |
16e345b4 | 29 | ok |
caa441d8 | 30 | touch /var/lock/subsys/wine |
31 | else | |
32 | msg_already_running "Wine" | |
16e345b4 | 33 | fi |
16e345b4 | 34 | ;; |
990dad56 | 35 | stop) |
caa441d8 | 36 | if [ -f /var/lock/subsys/wine ]; then |
37 | msg_stopping "Wine" | |
38 | echo "-1" > ${BINFMT_DIR}/windows | |
39 | echo "-1" > ${BINFMT_DIR}/windowsPE | |
40 | rm -f /var/lock/subsys/wine | |
41 | ok | |
42 | else | |
16e345b4 | 43 | msg_not_running "Wine" |
16e345b4 | 44 | fi |
16e345b4 | 45 | ;; |
989d349d | 46 | status) |
47 | ;; | |
990dad56 | 48 | *) |
989d349d | 49 | msg_usage "$0 {start|stop|restart|reload|force-reload|status}" |
50 | exit 3 | |
990dad56 | 51 | esac |
caa441d8 | 52 | |
53 | exit 0 |