summaryrefslogtreecommitdiffstats
path: root/move/tree/X_move
blob: dde4bcc32800213a93cc0695c8625b6a06ac42a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash

ok=0
lastdate1=0
lastdate0=0
while [ "$ok" == 0 -a ! -s /var/run/rebootctl ]; do
    lastdate2=$lastdate1
    lastdate1=$lastdate0
    lastdate0=`date +%s`
    if [ `expr $lastdate0 - $lastdate2` -lt 40 ]; then
        echo "X server respawning too fast :(, dropping to a shell"
        bash
    fi
    X $@
    ok=$?
done