34 lines
555 B
Bash
Executable File
34 lines
555 B
Bash
Executable File
#!/bin/bash
|
|
|
|
envinit() {
|
|
apt install -y wget ca-certificates nodejs npm git make g++ gcc
|
|
}
|
|
|
|
prebuild(){
|
|
VERSION=$1
|
|
cd /tmp/
|
|
git clone https://github.com/Koenkk/zigbee2mqtt.git
|
|
cd zigbee2mqtt/
|
|
git checkout $VERSION
|
|
}
|
|
|
|
build() {
|
|
cd /tmp/zigbee2mqtt/
|
|
npm ci
|
|
npm run build
|
|
}
|
|
|
|
makedeb(){
|
|
PATH_BUILD=$1
|
|
PATH_DEB=$2
|
|
GIT_VERSION=$3
|
|
|
|
cp -fr ${PATH_BUILD}/tmp/zigbee2mqtt/data/configuration.yaml ${PATH_DEB}/etc/zigbee2mqtt/configuration.yaml
|
|
cp -fr ${PATH_BUILD}/tmp/zigbee2mqtt/* ${PATH_DEB}/usr/lib/zigbee2mqtt/
|
|
}
|
|
|
|
echo $1
|
|
FUNC=$1
|
|
shift
|
|
${FUNC} $*
|