]> git.pld-linux.org Git - packages/binfmt-detector.git/commitdiff
- based on wine.init
authorwolf <wolf@pld-linux.org>
Mon, 1 May 2006 15:00:43 +0000 (15:00 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    binfmt-detector.init -> 1.1

binfmt-detector.init [new file with mode: 0644]

diff --git a/binfmt-detector.init b/binfmt-detector.init
new file mode 100644 (file)
index 0000000..07c561b
--- /dev/null
@@ -0,0 +1,59 @@
+#!/bin/sh
+# $Id$
+#
+# binfmt-detector:     Microsoft PE executable type detector. User can run
+#                      programs using Wine or Mono simply by clicking on them
+#                      or typing /file.exe
+#
+# chkconfig:   2345 95 10
+#
+# description: Microsoft PE executable type detector. User can run
+#              programs using Wine or Mono simply by 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/binfmt-detector ]; 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 "binfmt-detector"
+               echo ':windows:M::MZ::/usr/bin/binfmt-detector.sh:' > ${BINFMT_DIR}/register
+               echo ':windowsPE:M::PE::/usr/bin/binfmt-detector.sh:' > ${BINFMT_DIR}/register
+               ok
+               touch /var/lock/subsys/binfmt-detector
+       else
+               msg_already_running "binfmt-detector"
+       fi
+       ;;
+  stop)
+        if [ -f /var/lock/subsys/binfmt-detector ]; then
+               msg_stopping "binfmt-detector"
+               echo "-1" > ${BINFMT_DIR}/windows
+               echo "-1" > ${BINFMT_DIR}/windowsPE
+               rm -f /var/lock/subsys/binfmt-detector
+               ok
+       else
+               msg_not_running "binfmt-detector"
+       fi
+       ;;
+  restart)
+    $0 stop;
+    $0 start;
+       ;;
+  status)
+       ;;
+  *)
+       msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
+       exit 3
+esac
+
+exit 0
This page took 0.063456 seconds and 4 git commands to generate.