* One of the homebrew folks first asked for a wrapper script to make launching grafana easier. Later I was asked to remove it and submit it upstream, so here it is. * add instructions for installing grafana HEAD from git with homebrew back to the docs
27 lines
663 B
Bash
Executable File
27 lines
663 B
Bash
Executable File
#!/usr/bin/env bash
|
|
DAEMON=grafana-server
|
|
EXECUTABLE=/usr/local/bin/grafana-server
|
|
CONFIG=/usr/local/etc/grafana/grafana.ini
|
|
HOMEPATH=/usr/local/share/grafana
|
|
LOGPATH=/usr/local/var/log/grafana
|
|
DATAPATH=/usr/local/var/lib/grafana
|
|
PLUGINPATH=/usr/local/var/lib/grafana/plugins
|
|
|
|
case "$1" in
|
|
start)
|
|
$EXECUTABLE --config=$CONFIG --homepath=$HOMEPATH cfg:default.paths.logs=$LOGPATH cfg:default.paths.data=$DATAPATH cfg:default.paths.plugins=$PLUGINPATH 2> /dev/null &
|
|
[ $? -eq 0 ] && echo "$DAEMON started"
|
|
;;
|
|
stop)
|
|
killall $DAEMON
|
|
[ $? -eq 0 ] && echo "$DAEMON stopped"
|
|
;;
|
|
restart)
|
|
$0 stop
|
|
$0 start
|
|
;;
|
|
*)
|
|
echo "Usage: $0 (start|stop|restart)"
|
|
;;
|
|
esac
|