6
0
Fork 0
This repository has been archived on 2022-03-14. You can view files and clone it, but cannot push or open issues or pull requests.
cdist-recycledcloud/type/__prometheus_yoctotemp_expo.../gencode-remote

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