-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-plugin.sh
20 lines (18 loc) · 1.11 KB
/
install-plugin.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
if [ ! -d /usr/local/fledge/python/fledge/plugins/south/mqtt-publisher ]
then
#creates new plugin folder on local fledge installation if there is none
echo "mqtt-publisher file doesn't exist; creating new file"
sudo mkdir /usr/local/fledge/python/fledge/plugins/south/mqtt-publisher
sudo cp python/plugins/south/mqtt-publisher/mqtt-publisher.py /usr/local/fledge/python/fledge/plugins/south/mqtt-publisher
sudo cp python/plugins/south/mqtt-publisher/__init__.py /usr/local/fledge/python/fledge/plugins/south/mqtt-publisher
sudo cp python/requirements.txt /usr/local/fledge/python/fledge/plugins/south/mqtt-publisher
sudo cp VERSION.south.mqtt-publisher /usr/local/fledge/python/fledge/plugins/south/mqtt-publisher
else
#if there is a plugin folder already, only copies the plugin code to the preexisting folder
echo "mqtt-publisher file already exists"
sudo cp python/plugins/south/mqtt-publisher/mqtt-publisher.py /usr/local/fledge/python/fledge/plugins/south/mqtt-publisher
fi
./../../fledge/scripts/fledge stop
sudo ./../../fledge/scripts/fledge start
echo "mqtt-publisher installed"