#!/bin/bash TIMESTAMP=$(date +%s) if ! touch /tmp/$TIMESTAMP; then echo 'CRITICAL: Unable to touch tmp'; exit 2; else rm -f /tmp/$TIMESTAMP; echo 'OK: Successfully touched tmp'; exit 0; fi