fhem - separate step for jabber deps
This commit is contained in:
40
seqs/fhem.sh
40
seqs/fhem.sh
@@ -1,13 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
toolName="fhem"
|
||||
toolUser="$toolName"
|
||||
toolHome="/opt/fhem"
|
||||
toolVersion="6.0"
|
||||
toolDpkg="fhem-${toolVersion}.deb"
|
||||
toolUrl="http://fhem.de/$toolDpkg"
|
||||
readonly toolName="fhem"
|
||||
readonly toolUser="$toolName"
|
||||
readonly toolHome="/opt/fhem"
|
||||
readonly toolVersion="6.1"
|
||||
readonly toolDpkg="fhem-${toolVersion}.deb"
|
||||
readonly toolUrl="http://fhem.de/${toolDpkg}"
|
||||
# default deps listed at https://debian.fhem.de/
|
||||
toolDeps="perl-base libdevice-serialport-perl libwww-perl libio-socket-ssl-perl libcgi-pm-perl libjson-perl sqlite3 libdbd-sqlite3-perl libtext-diff-perl libtimedate-perl libmail-imapclient-perl libgd-graph-perl libtext-csv-perl libxml-simple-perl liblist-moreutils-perl fonts-liberation2 libimage-librsvg-perl libgd-text-perl libsocket6-perl libio-socket-inet6-perl libmime-base64-urlsafe-perl libimage-info-perl libusb-1.0-0-dev libnet-server-perl"
|
||||
readonly toolDeps="perl-base libdevice-serialport-perl libwww-perl libio-socket-ssl-perl libcgi-pm-perl libjson-perl sqlite3 libdbd-sqlite3-perl libtext-diff-perl libtimedate-perl libmail-imapclient-perl libgd-graph-perl libtext-csv-perl libxml-simple-perl liblist-moreutils-perl fonts-liberation2 libimage-librsvg-perl libgd-text-perl libsocket6-perl libio-socket-inet6-perl libmime-base64-urlsafe-perl libimage-info-perl libusb-1.0-0-dev libnet-server-perl"
|
||||
toolDeps2="libdate-manip-perl libhtml-treebuilder-xpath-perl libmojolicious-perl libxml-bare-perl libauthen-oath-perl libconvert-base32-perl libmodule-pluggable-perl libnet-bonjour-perl libcrypt-urandom-perl"
|
||||
# for rounding operations e.g.:
|
||||
# { use Math::Round qw/nearest/;; nearest('0.01',ReadingsVal("1WT_28_5728E9070000", "temperature", 0)-1.1);; }
|
||||
@@ -15,15 +15,7 @@ toolDeps2+=" libmath-round-perl"
|
||||
# for fritzbox connection
|
||||
toolDeps2+=" libsoap-lite-perl libjson-xs-perl"
|
||||
# for xmpp support (no special solution needed for raspbian buster)
|
||||
toolDeps2+=" libnet-xmpp-perl libxml-stream-perl libnet-jabber-perl"
|
||||
|
||||
|
||||
# Get script working directory
|
||||
# (when called from a different directory)
|
||||
WDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >>/dev/null 2>&1 && pwd )"
|
||||
WSUBDIR="${WDIR}/${toolName}"
|
||||
#CONFIG_FILE="$WDIR/${toolName}.cfg"
|
||||
#CONFIG_FILE_DEFAULT="${CONFIG_FILE}.example"
|
||||
toolDepsJabber=" libnet-xmpp-perl libxml-stream-perl libnet-jabber-perl"
|
||||
|
||||
#step_config() {
|
||||
# echo "Called once before executing steps."
|
||||
@@ -44,20 +36,22 @@ step_1() {
|
||||
endReturn -o $? "Installation of prerequisits failed"
|
||||
}
|
||||
|
||||
step_2_info() { echo "Download and install $toolName version $toolVersion"; }
|
||||
step_2_info() { echo "Install jabber prerequisits"; echoinfo "(May be skipped)"; }
|
||||
step_2() {
|
||||
exe apt install $toolDepsJabber "$aptOpt"
|
||||
endReturn -o $? "Installation of prerequisits for jabber failed"
|
||||
}
|
||||
|
||||
step_3_info() { echo "Download and install $toolName version $toolVersion"; }
|
||||
step_3() {
|
||||
exe wget "$toolUrl" -O "$downPath"
|
||||
endReturn -o $? "Download of $toolName failed"
|
||||
exe dpkg -i "$downPath"
|
||||
endReturn -o $? "Installation of $toolName failed"
|
||||
info "$toolName is now running on http://$(hostname -I | cut -d " " -f 1):8083"
|
||||
}
|
||||
downPath="/tmp/$toolDpkg"
|
||||
|
||||
step_3_info() { echo "Start $toolName service"; }
|
||||
step_3() {
|
||||
exe systemctl restart fhem.service
|
||||
}
|
||||
|
||||
step_20_info() { echo "List $toolName prerequisits"; }
|
||||
step_20_alias() { echo "listdeps"; }
|
||||
step_20() {
|
||||
@@ -147,7 +141,7 @@ step_40_info() { echo "Execute fhem [COMMAND]"; }
|
||||
step_40_alias() { echo "exe"; }
|
||||
step_40() {
|
||||
shift
|
||||
exe perl "${toolHome}/fhem.pl" 7072 "$1"
|
||||
exe perl "${toolHome}/fhem.pl" 7072 "${1:-}"
|
||||
}
|
||||
|
||||
readonly sqr_minVersion=16
|
||||
|
Reference in New Issue
Block a user