freenetis-monitoring-github/test/install.sh @ 337d1648
344ad33b | Ondřej Fibich | #!/bin/sh
|
|
set -e
|
|||
if [ $# -ne 1 ]; then
|
|||
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
|
|||
337d1648 | Ondřej Fibich | if [ apt --version ]; then
|
|
apt install -q -y "$DEB"
|
|||
else
|
|||
dpkg -i "$DEB"
|
|||
apt install -q -y -f
|
|||
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."
|