#!/bin/bash case `/usr/bin/tty` in /dev/tty[0-9]*) echo -e "\nLocal login - finding X-Lockfile.\n" if [ -f /tmp/.X0-lock ]; then echo -e "X-Lockfile present - X will not be started.\n" else echo "X is not active - starting X in 5 seconds (abort using Ctrl-C) ..." sleep 1s echo "4 seconds ..." sleep 1s echo "3 seconds ..." sleep 1s echo "2 seconds ..." sleep 1s echo -e "1 seconds ...\a" sleep 1s if [ $? -eq 0 ]; then startx fi fi esac