So this is the real solution:
(echo "OFFLINE";bash -c 'docker exec -it storagenode /app/dashboard.sh | head -9 | grep "Status" | cut -c8-') | tail -1