#!/bin/sh

# Payload here:
# m=$(ssh dbi@kut-download.tail 'docker exec sonarr [ "$(ls -A /mnt/unionfs)" ] && echo "OK" || echo "NOK" 2>&1')

ssh dbi@kut-download.tail "docker exec sonarr [ 'find /mnt/unionfs -maxdepth 1 -type d | wc -l' > 1 ]"

[[ $(mount |awk '{print $3}'| grep -w /mnt/unionfs) != '' ]]; curl -fsS -m 10 --retry 5  https://hc-ping.com/ca386c65-9bc6-4d17-bad5-d492c5beaf5f/$?