#!/bin/bash ok=0 while [ "$ok" == 0 -a ! -f /tmp/reboot ]; do X $@ ok=$? done