23 lines
575 B
Bash
Executable File
23 lines
575 B
Bash
Executable File
#!/bin/sh
|
|
|
|
VCS_TAG=$(cat "$__object/parameter/version")
|
|
VCS_URL="https://code.recycled.cloud/RecycledCloud/prometheus-yoctotemp-exporter/raw/tag/$VCS_TAG/prometheus-yoctotemp-exporter"
|
|
|
|
cat << EOF
|
|
if [ ! -d /opt/prometheus-yoctotemp-exporter ]; then
|
|
cd /opt/prometheus-yoctotemp-exporter
|
|
|
|
# Fetch sources.
|
|
curl "$VCS_URL" -o prometheus-yoctotemp-exporter
|
|
|
|
# Install virtualenv and dependencies.
|
|
virtualenv -p python3 venv
|
|
. venv/bin/activate
|
|
pip install prometheus_client
|
|
pip install yoctopuce
|
|
|
|
# Start service
|
|
service prometheus-yoctotemp-exporter start
|
|
fi
|
|
EOF
|