Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > 4d93b4709982476e9dbb8490886e8dec > files > 13

wine-20030115-4mdk.src.rpm

#!/bin/bash
#
# wine		Allow users to run Windows(tm) applications by just clicking
#		on them (or typing ./file.exe)
#
# chkconfig: 2345 99 10
# description: Allow users to run Windows(tm) applications by just clicking \\
# on them (or typing ./file.exe)

RETVAL=0

function start () {
    /sbin/modprobe binfmt_misc &>/dev/null
    RETVAL=$?
    echo ':windows:M::MZ::/usr/bin/wine:' >/proc/sys/fs/binfmt_misc/register
    echo ':windowsPE:M::PE::/usr/bin/wine:' >/proc/sys/fs/binfmt_misc/register
    touch /var/lock/subsys/wine
    return $RETVAL
}

function stop () {
    echo "-1" >/proc/sys/fs/binfmt_misc/windows
    echo "-1" >/proc/sys/fs/binfmt_misc/windowsPE
    RETVAL=$?
    rm -f /var/lock/subsys/wine
    return $RETVAL
}

[[ -d /proc/sys/fs/binfmt_misc ]] || exit $RETVAL

case "$1" in
    start)start;;
    stop)stop;;
    status)[[ -e /proc/sys/fs/binfmt_misc/windows ]] && echo Wine Registration enabled || echo Wine Registration disabled ;;
    restart);;
    reload);;
    *) echo "Usage: ${0##*/} {start|status|stop}"; exit 1;
esac

exit $RETVAL