2005-09-28 09:25:37 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
killproc() { # kill the named process(es)
|
|
|
|
pid=`/bin/ps -e x |
|
|
|
|
/bin/grep $1 |
|
|
|
|
/bin/grep -v grep |
|
|
|
|
/bin/sed -e 's/^ *//' -e 's/ .*//'`
|
|
|
|
[ "$pid" != "" ] && kill $pid
|
|
|
|
}
|
|
|
|
|
2006-09-03 14:26:12 +00:00
|
|
|
for x in $(cat /proc/cmdline); do
|
|
|
|
case $x in
|
|
|
|
x11=false)
|
|
|
|
echo "X Server disabled"
|
|
|
|
exit 0;
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2005-09-28 09:25:37 +00:00
|
|
|
case "$1" in
|
|
|
|
start)
|
2006-06-22 09:28:53 +00:00
|
|
|
# We don't want this script to block the rest of the boot process
|
|
|
|
if [ "$2" != "background" ]; then
|
|
|
|
$0 $1 background &
|
|
|
|
else
|
|
|
|
. /etc/profile
|
|
|
|
|
2005-09-28 09:25:37 +00:00
|
|
|
echo "Starting Xserver"
|
|
|
|
/etc/X11/Xserver &
|
2006-06-22 09:28:53 +00:00
|
|
|
fi
|
2005-09-28 09:25:37 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
stop)
|
|
|
|
echo "Stopping XServer"
|
2006-08-23 10:44:12 +00:00
|
|
|
killproc xinit
|
|
|
|
;;
|
|
|
|
|
|
|
|
restart)
|
|
|
|
$0 stop
|
|
|
|
sleep 1
|
|
|
|
$0 start
|
2005-09-28 09:25:37 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
2006-08-23 10:44:12 +00:00
|
|
|
echo "usage: $0 { start | stop | restart }"
|
2005-09-28 09:25:37 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit 0
|