summaryrefslogtreecommitdiffstats
path: root/.displayrc.common
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2016-03-14 02:12:22 (EDT)
committer P. J. McDermott <pj@pehjota.net>2016-03-14 02:12:22 (EDT)
commit069e68335ab88cb319071ff8fc432a6fecb7856b (patch)
tree001828d8df0c442a5cbd76759fbe40a57852645b /.displayrc.common
downloaddisplayrc-069e68335ab88cb319071ff8fc432a6fecb7856b.zip
displayrc-069e68335ab88cb319071ff8fc432a6fecb7856b.tar.gz
displayrc-069e68335ab88cb319071ff8fc432a6fecb7856b.tar.bz2
Initial commit
Diffstat (limited to '.displayrc.common')
-rw-r--r--.displayrc.common39
1 files changed, 39 insertions, 0 deletions
diff --git a/.displayrc.common b/.displayrc.common
new file mode 100644
index 0000000..54a6dc3
--- /dev/null
+++ b/.displayrc.common
@@ -0,0 +1,39 @@
+#!/bin/sh
+# TODO: Enable/disable actions
+
+type restart >/dev/null ||
+restart()
+{
+ stop
+ start
+}
+
+type reload >/dev/null ||
+reload()
+{
+ stop
+ start
+}
+
+usage()
+{
+ printf 'Usage: %s {start|stop|restart|reload}\n' "${0}"
+}
+
+main()
+{
+ local action="${1}"
+
+ case "${action}" in
+ 'start'|'stop'|'restart'|'reload');;
+ *)
+ usage >&2
+ return 1
+ ;;
+ esac
+
+ "${action}"
+ return ${?}
+}
+
+main "${@}"