summaryrefslogtreecommitdiffstats
path: root/tools/linux
diff options
context:
space:
mode:
Diffstat (limited to 'tools/linux')
-rw-r--r--tools/linux/Makefile.am38
-rwxr-xr-xtools/linux/ck-system-restart12
-rwxr-xr-xtools/linux/ck-system-stop12
3 files changed, 46 insertions, 16 deletions
diff --git a/tools/linux/Makefile.am b/tools/linux/Makefile.am
index 0830734..51196c0 100644
--- a/tools/linux/Makefile.am
+++ b/tools/linux/Makefile.am
@@ -6,27 +6,33 @@ NULL =
SUBDIRS = \
$(NULL)
-INCLUDES = \
- -I. \
- -I$(srcdir) \
- -I$(top_srcdir)/src \
- $(CONSOLE_KIT_CFLAGS) \
- $(DISABLE_DEPRECATED_CFLAGS) \
- -DPREFIX=\""$(prefix)"\" \
- -DBINDIR=\""$(bindir)"\" \
- -DLIBDIR=\""$(libdir)"\" \
- -DLIBEXECDIR=\""$(libexecdir)"\" \
- -DDATADIR=\""$(datadir)"\" \
- -DSYSCONFDIR=\""$(sysconfdir)"\" \
- $(WARN_CFLAGS) \
- $(DEBUG_CFLAGS) \
- $(TOOLS_CFLAGS) \
+scriptdir = $(libdir)/ConsoleKit/scripts
+script_SCRIPTS = \
+ ck-system-stop \
+ ck-system-restart \
$(NULL)
-
EXTRA_DIST = \
+ $(script_SCRIPTS) \
$(NULL)
MAINTAINERCLEANFILES = \
*~ \
Makefile.in
+
+
+check:
+ for f in $(script_SCRIPTS); do \
+ echo -n "Validate bash syntax in $$f : "; \
+ bash -n $(srcdir)/$$f 2> bash.error;\
+ if test -s bash.error; then \
+ echo failed; \
+ cat bash.error; \
+ rm -f bash.error; \
+ exit 1; \
+ else \
+ echo ok; \
+ rm -f bash.error; \
+ fi; \
+ done;
+
diff --git a/tools/linux/ck-system-restart b/tools/linux/ck-system-restart
new file mode 100755
index 0000000..8e0664e
--- /dev/null
+++ b/tools/linux/ck-system-restart
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+#Try for common tools
+if [ -x "/sbin/shutdown" ] ; then
+ /sbin/shutdown -r now
+ exit $?
+elif [ -x "/usr/sbin/shutdown" ] ; then
+ /usr/sbin/shutdown -r now
+ exit $?
+else
+ exit 1
+fi
diff --git a/tools/linux/ck-system-stop b/tools/linux/ck-system-stop
new file mode 100755
index 0000000..e26bca3
--- /dev/null
+++ b/tools/linux/ck-system-stop
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+#Try for common tools
+if [ -x "/sbin/shutdown" ] ; then
+ /sbin/shutdown -h now
+ exit $?
+elif [ -x "/usr/sbin/shutdown" ] ; then
+ /usr/sbin/shutdown -h now
+ exit $?
+else
+ exit 1
+fi