Commit f6142b58 authored by santiago duque's avatar santiago duque

changed wait for x

parent 096b62dd
#!/bin/bash
# wait-for-x.sh
# home/squareclouds
until [ -S /tmp/.X11-unix/X0 ]; do
# Warte bis ein USB-Gerät auftaucht
TIMEOUT=30
SECONDS_WAITED=0
echo "Waiting for X..."
while ! pgrep -x Xorg > /dev/null; do
sleep 1
done
echo "Waiting for USB (max $TIMEOUT sec)..."
while [ $SECONDS_WAITED -lt $TIMEOUT ]; do
if lsblk | grep -q 'sd[b-z]'; then
echo "USB device detected."
break
fi
sleep 1
SECONDS_WAITED=$((SECONDS_WAITED + 1))
done
exit 0
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment