diff options
-rwxr-xr-x | munin/munin.SlackBuild | 29 | ||||
-rwxr-xr-x | munin/munin.build | 55 | ||||
-rwxr-xr-x | munin/rc.munin-node | 23 |
3 files changed, 62 insertions, 45 deletions
diff --git a/munin/munin.SlackBuild b/munin/munin.SlackBuild new file mode 100755 index 00000000..a8c1007f --- /dev/null +++ b/munin/munin.SlackBuild @@ -0,0 +1,29 @@ +#!/bin/bash +# +# SlackBuild script to call munin.build with correct settings +# + +CWD="`pwd`" + +if [ -f "/etc/slackbuildrc" ]; then + source /etc/slackbuildrc +fi + +if [ -f "~/.slackbuildrc" ]; then + source ~/.slackbuildrc +fi + +# default settings +PACKAGE="munin" +VERSION=${VERSION:=1.2.4} +ARCH="noarch" +BUILD=${BUILD:=3rha} +SRC_DIR=${SRC:=$CWD} +TMP=${TMP:=/tmp} +REPOS=${REPOS:=$TMP} + +rm -rf $TMP/$PACKAGE +mkdir -p $SRC_DIR/$PACKAGE $TMP/$PACKAGE + +slacktrack -x $TMP,$SRC_DIR,/dev -jefkzp "$REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz" "./$PACKAGE.build" + diff --git a/munin/munin.build b/munin/munin.build index bde73374..9339c483 100755 --- a/munin/munin.build +++ b/munin/munin.build @@ -13,12 +13,21 @@ CWD="`pwd`" +if [ -f "/etc/slackbuildrc" ]; then + source /etc/slackbuildrc +fi + +if [ -f "~/.slackbuildrc" ]; then + source ~/.slackbuildrc +fi + # default settings PACKAGE="munin" -_TMP="/tmp" -_VERSION="1.2.4" -_ARCH="i386" -_BUILD="2rha" +TMP=${TMP:=/tmp} +VERSION=${VERSION:=1.2.4} +ARCH=${ARCH:=i386} +BUILD=${BUILD:=3rha} +SRC_DIR=${SRC:=$CWD} if ! grep -qe "^$PACKAGE:" /etc/passwd || ! grep -qe "^$PACKAGE:" /etc/group; then echo "WARNING: user and/or group $PACKAGE does not exist" @@ -36,46 +45,17 @@ EOCAT read garbage -if [ -f "/etc/slackbuildrc" ]; then - source /etc/slackbuildrc -fi - -if [ -f "~/.slackbuildrc" ]; then - source ~/.slackbuildrc -fi - -if [ -z "$VERSION" ]; then - VERSION="$_VERSION" -fi - -if [ -z "$ARCH" ]; then - ARCH="$_ARCH" -fi - -if [ -z "$BUILD" ]; then - BUILD="$_BUILD" -fi - if [ "$ARCH" == "x86_64" ]; then LIBDIR=/usr/lib64 else LIBDIR=/usr/lib fi -if [ -z "$SRC" ]; then - SRC_DIR="$CWD" -else - SRC_DIR="$SRC" -fi - -if [ -z "$TMP" ]; then - TMP="$_TMP" -fi - RTOOL="wget" PACKAGE_EXT="gz" SRC="$PACKAGE"_"$VERSION.tar.$PACKAGE_EXT" URL="http://easynews.dl.sourceforge.net/sourceforge/$PACKAGE/$SRC" +SRC_DIR="$SRC_DIR/$PACKAGE" if [ "$RTOOL" == "wget" ] && [ ! -f "$SRC_DIR/$SRC" ]; then rm -f $SRC_DIR/$SRC @@ -88,9 +68,10 @@ else tarflag="z" fi -rm -rf $TMP/package-$PACKAGE -mkdir $TMP/package-$PACKAGE -cd $TMP/package-$PACKAGE +TMP="$TMP/$PACKAGE" +mkdir -p $TMP/package-$PACKAGE +cd $TMP + tar xvf$tarflag $SRC_DIR/$SRC cd $PACKAGE-$VERSION diff --git a/munin/rc.munin-node b/munin/rc.munin-node index 0dcac8a4..f7cec18d 100755 --- a/munin/rc.munin-node +++ b/munin/rc.munin-node @@ -1,23 +1,30 @@ #!/bin/bash +# +# startup script for munin-node +# + +PID_FILE="/var/run/munin/munin-node.pid" if [ -a "/var/run/munin/munin-node.pid" ]; then - NODE_PID="`cat /var/run/munin/munin-node.pid`" + NODE_PID="`cat $PID_FILE`" fi -function munin_node_start { +function munin_start { /usr/sbin/munin-node } -function munin_node_stop { - kill -9 $NODE_PID &> /dev/null +function munin_stop { + if [ "$NODE_PID" == "`pidof munin-node`" ]; then + kill $NODE_PID + fi } if [ "$1" == "start" ]; then - munin_node_start + munin_start elif [ "$1" == "stop" ]; then - munin_node_stop + munin_stop elif [ "$1" == "restart" ]; then - munin_node_stop - munin_node_start + munin_stop + munin_start fi |