summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichiel van Wessem <michiel@slackbuilds.org>2011-03-02 20:52:07 -0300
committerNiels Horn <niels.horn@slackbuilds.org>2011-03-02 20:52:07 -0300
commit79a55aefe30b0e8d50b1b2724a7fd78d4c2437d3 (patch)
tree87a74e1ea97de53467cabbaa8094349c1208dfc5
parent419ccb1bc0d955776bf7c2008df3b6f387e00518 (diff)
downloadslackbuilds-79a55aefe30b0e8d50b1b2724a7fd78d4c2437d3.tar.gz
network/vnstat: Fixed code in rc.vnstat
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
-rw-r--r--network/vnstat/rc.vnstat44
-rw-r--r--network/vnstat/vnstat.SlackBuild9
-rw-r--r--network/vnstat/vnstat.info2
3 files changed, 28 insertions, 27 deletions
diff --git a/network/vnstat/rc.vnstat b/network/vnstat/rc.vnstat
index bb9e948c02..e17d7cdeeb 100644
--- a/network/vnstat/rc.vnstat
+++ b/network/vnstat/rc.vnstat
@@ -43,6 +43,15 @@ vnstat_stop() {
fi
}
+vnstat_status() {
+ pid="$(pidof $1)"
+ if [ -n "$pid" ]; then
+ echo "vnstat daemon is running with pid $pid"
+ else
+ echo "vnstat daemon is not running."
+ fi
+}
+
vnstat_restart() {
echo "restarting the vnstart daemon..."
vnstat_stop
@@ -50,24 +59,21 @@ vnstat_restart() {
vnstat_start
}
-
case "$1" in
- 'start')
- vnstat_start
- ;;
- 'stop')
- vnstat_stop
- ;;
- 'restart','reload')
- vnstat_restart
- ;;
- 'status')
- vnstat_status
- ;;
- *)
- echo "Usage: $0 {start|stop|restart|reload|status}"
- exit 1
- ;;
+ 'start')
+ vnstat_start
+ ;;
+ 'stop')
+ vnstat_stop
+ ;;
+ 'restart'|'reload')
+ vnstat_restart
+ ;;
+ 'status')
+ vnstat_status vnstatd
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|reload|status}"
+ exit 1
+ ;;
esac
-
-
diff --git a/network/vnstat/vnstat.SlackBuild b/network/vnstat/vnstat.SlackBuild
index 23daea7ac9..7cd7493177 100644
--- a/network/vnstat/vnstat.SlackBuild
+++ b/network/vnstat/vnstat.SlackBuild
@@ -27,12 +27,10 @@ VERSION=${VERSION:-1.10}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
-# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
arm*) ARCH=arm ;;
- # Unless $ARCH is already set, use uname -m for all other archs:
*) ARCH=$( uname -m ) ;;
esac
fi
@@ -55,7 +53,6 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-# Exit on most errors.
set -e
# vnstat doesn't have a proper configure. So we set the locations in the
@@ -85,10 +82,8 @@ make install DESTDIR=$PKG
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
-( cd $PKG/usr/man
- find . -type f -exec gzip -9 {} \;
- for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
-)
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/examples
cp -a CHANGES COPYING FAQ INSTALL* README UPGRADE UNINSTALL examples \
diff --git a/network/vnstat/vnstat.info b/network/vnstat/vnstat.info
index 11d17623f7..94390219db 100644
--- a/network/vnstat/vnstat.info
+++ b/network/vnstat/vnstat.info
@@ -7,4 +7,4 @@ DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
MAINTAINER="Michiel van Wessem"
EMAIL="michiel@slackbuilds.org"
-APPROVED="dsomero"
+APPROVED="Niels Horn"