nsbin/greeting_intro_play
Nico Schottelius d3c6e29902 Initial commit
2006-07-20 09:54:37 +02:00

36 lines
724 B
Bash
Executable file

#!/bin/sh
# Nico Schottelius
# 10-Jan-2003
# startup locked playing for the login process
#
LOCKFILE=~/.greet.lock
PID=`cat $LOCKFILE 2>/dev/null`
PLAYER="tracker"
FILE=~/pub/computer/audio/music/mods/cold_blood.mod
trap "rm -f $LOCKFILE; exit 1" ALRM HUP INT KILL TERM
if [ -f "$LOCKFILE" ]; then
echo runtest
# check if process still exists, then exit
kill -WINCH $PID 2>/dev/null && exit 0
echo seems not run
fi
# this is wrong, but kill sees we exist now
echo $$ > "$LOCKFILE"
# startup playing & automatic cleanup
(
"$PLAYER" "$FILE" &>/dev/null
rm -f "$LOCKFILE"
) &
##"$PLAYER" "$FILE" &>/dev/null &
# set the correct lockpid: $! is wrong...
echo $! > $LOCKFILE
##fg
##rm -f "$LOCKFILE"