#!/bin/sh # $Id$ # # wine: Allow users to run Windows(tm) applications by just clicking # on them (or typing ./file.exe) # # chkconfig: 2345 95 10 # # description: Allow users to run Windows(tm) applications by just clicking \ # on them (or typing ./file.exe) # # Source function library . /etc/rc.d/init.d/functions BINFMT_DIR='/proc/sys/fs/binfmt_misc' case "$1" in start|reload|force-reload) if [ ! -f /var/lock/subsys/wine ]; then # check if binfmt_misc is not already mounted if ! /bin/mount | grep -q "${BINFMT_DIR} type binfmt_misc"; then /bin/mount none -t binfmt_misc /proc/sys/fs/binfmt_misc fi msg_starting "Wine" echo ':windows:M::MZ::/usr/bin/wine:' > ${BINFMT_DIR}/register echo ':windowsPE:M::PE::/usr/bin/wine:' > ${BINFMT_DIR}/register ok touch /var/lock/subsys/wine else msg_already_running "Wine" fi ;; stop) if [ -f /var/lock/subsys/wine ]; then msg_stopping "Wine" echo "-1" > ${BINFMT_DIR}/windows echo "-1" > ${BINFMT_DIR}/windowsPE rm -f /var/lock/subsys/wine ok else msg_not_running "Wine" fi ;; restart) $0 stop; $0 start; ;; status) ;; *) msg_usage "$0 {start|stop|restart|reload|force-reload|status}" exit 3 esac exit 0