summaryrefslogtreecommitdiffstats
path: root/.displayrc.common
blob: 54a6dc3e8d9d46f4657d5f0fe55c516c5ee4d91a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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 "${@}"