summaryrefslogtreecommitdiff
path: root/initscript
diff options
context:
space:
mode:
authorAlex Vogt <elias@linexa.de>2010-10-08 23:03:10 -0500
committerDan Williams <dcbw@redhat.com>2010-10-08 23:03:10 -0500
commitd40c81b06a1f947b1b9a2d727683a31bfb10bebc (patch)
tree8945a1a2173318a08ccc95fa54e1faba80d7b6b4 /initscript
parentbe97e7f10498d49b7632cbcdfa866bcdf47e174e (diff)
linexa: add basic Linexa support
Diffstat (limited to 'initscript')
-rw-r--r--initscript/Makefile.am3
-rw-r--r--initscript/linexa/Makefile.am6
-rw-r--r--initscript/linexa/networkmanager.in59
3 files changed, 68 insertions, 0 deletions
diff --git a/initscript/Makefile.am b/initscript/Makefile.am
index 4cc710eba4..65555e3eff 100644
--- a/initscript/Makefile.am
+++ b/initscript/Makefile.am
@@ -23,3 +23,6 @@ endif
if TARGET_MANDRIVA
SUBDIRS += Mandriva
endif
+if TARGET_LINEXA
+SUBDIRS += linexa
+endif
diff --git a/initscript/linexa/Makefile.am b/initscript/linexa/Makefile.am
new file mode 100644
index 0000000000..0a0cc2bb3e
--- /dev/null
+++ b/initscript/linexa/Makefile.am
@@ -0,0 +1,6 @@
+EXTRA_DIST = networkmanager
+DISTCLEANFILES = networkmanager
+
+initddir = $(sysconfdir)/rc.d/init.d
+initd_SCRIPTS = networkmanager
+
diff --git a/initscript/linexa/networkmanager.in b/initscript/linexa/networkmanager.in
new file mode 100644
index 0000000000..0d754c3604
--- /dev/null
+++ b/initscript/linexa/networkmanager.in
@@ -0,0 +1,59 @@
+#!/bin/bash
+# Start the networkmanager daemon
+#
+# Author: Elias <elias@linexa.de>
+# [2010-08-20]
+
+# Information about the daemon
+title="networkmanager" # No spaces allowed in here
+start_after="dbus" # dependencies for start-up
+stop_after="xinetd" # dependencies for stop
+runlevel="2" # start/stop in this runlevel
+sequence="25" # "checkinstall networkmanager enable"
+ # will create links to:
+ # /etc/rc.d/rc${runlevel}.d/S${sequence}${title}
+ # /etc/rc.d/rc${runlevel}.d/S$((100 - ${sequence}))${title}
+
+# check whether daemon is running
+# returns 0 if running, >0 if not
+check() {
+ [ -f /var/run/NetworkManager.pid ]
+}
+
+# start procedure
+start() {
+ if check ; then
+ warning "${title} is already running. Type 'service restart ${title}'" # Issue a warning
+ else
+ /usr/sbin/NetworkManager &
+ evaluate_retval "Starting ${title}. " # Print [ done ] or [ failed ] depending on outcome
+ fi
+}
+
+# stop procedure
+stop() {
+ if check ; then # daemon is running
+ kill $(cat /var/run/NetworkManager.pid)
+ evaluate_retval "Stopping ${title}." # Print [ done ] or [ failed ] depending on outcome
+ else # daemon not running
+ warning "${title} is not running." # Issue a warning
+ fi
+}
+
+# restart procedure
+restart() {
+ stop
+ sleep 1
+ start
+}
+
+# reload action
+reload() {
+ if check ; then # daemon is running
+ kill -HUP $(cat /var/run/NetworkManager.pid) &>/dev/null
+ evaluate_retval "Reloading ${title}." # Print [ done ] or [ failed ] depending on outcome
+ else # daemon not running
+ warning "${title} is not running." # Issue a warning
+ fi
+}
+