Make bootstrap collectd restart conditional
- only restart if the config file changes
This commit is contained in:
parent
664e57db37
commit
550fe7daa3
|
@ -20,7 +20,8 @@ ipvsadm -A -t ${EXTIP}:8080 -s rr
|
||||||
|
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
|
|
||||||
CF=/etc/collectd/collectd.conf.d/curl_json.conf
|
CF=/etc/collectd/collectd.conf.d/curl_json.conf.new
|
||||||
|
CF_LIVE=/etc/collectd/collectd.conf.d/curl_json.conf
|
||||||
|
|
||||||
echo "LoadPlugin curl_json" > $CF
|
echo "LoadPlugin curl_json" > $CF
|
||||||
echo "<Plugin curl_json>" >> $CF
|
echo "<Plugin curl_json>" >> $CF
|
||||||
|
@ -60,6 +61,10 @@ for i in `seq 1 $THREADS`; do
|
||||||
EOF
|
EOF
|
||||||
done
|
done
|
||||||
echo "</Plugin>" >> $CF
|
echo "</Plugin>" >> $CF
|
||||||
systemctl restart collectd
|
|
||||||
|
if ! cmp -s $CF $CF_LIVE; then
|
||||||
|
mv $CF $CF_LIVE
|
||||||
|
systemctl restart collectd
|
||||||
|
fi
|
||||||
|
|
||||||
ipvsadm -l -n
|
ipvsadm -l -n
|
||||||
|
|
Reference in New Issue
Block a user