Projekt

Obecné

Profil

Stáhnout (681 Bajtů) Statistiky
| Větev: | Tag: | Revize:
b2b193a3 Ondřej Fibich
#!/bin/bash
344ad33b Ondřej Fibich
set -e

36d16c7a Ondřej Fibich
if [ $# -lt 1 ]; then
344ad33b Ondřej Fibich
echo "usage: $0 DEB"
exit 2
fi

DEB="$1"
UNIT=/etc/init.d/freenetis-monitoring

export DEBIAN_FRONTEND=noninteractive

echo "Install deb package"
apt-get update -q
36d16c7a Ondřej Fibich
if [ "$2" == "old" ]; then
echo "Old style installation"
5e6a309b Ondřej Fibich
dpkg -i "$DEB" || apt-get install -q -y -f
36d16c7a Ondřej Fibich
else
apt install -q -y "$DEB"
337d1648 Ondřej Fibich
fi
344ad33b Ondřej Fibich
echo "Daemon test"
$UNIT version
$UNIT status | grep "FreenetIS monitor daemon is not running."
$UNIT start | grep "Starting FreenetIS monitor daemon: OK"
$UNIT status | grep "FreenetIS monitor daemon is running."
$UNIT stop | grep "Stopping FreenetIS monitor daemon: OK"
$UNIT status | grep "FreenetIS monitor daemon is not running."