xrdp_control.sh is a bash script

ulab-original
jsorg71 18 years ago
parent 079879db18
commit b611452d6b

@ -1,6 +1,8 @@
#!/bin/sh #!/bin/bash
# this needs to be a bash script, the first line needs to be #!/bin/bash
# xrdp control script # xrdp control script
# Written : 1-13-2006 - Mark Balliet - posicat@pobox.com # Written : 1-13-2006 - Mark Balliet - posicat@pobox.com
# maintaned by Jay Sorg
# chkconfig: 2345 11 89 # chkconfig: 2345 11 89
# description: starts xrdp # description: starts xrdp
@ -39,55 +41,61 @@ check_up () {
# Cleanup : If sesman isn't running, but the pid exists, erase it. # Cleanup : If sesman isn't running, but the pid exists, erase it.
if [ "$sesup" == "" ] if [ "$sesup" == "" ]
then then
if [ -e /var/run/sesman.pid ] ; then rm /var/run/sesman.pid ; fi if [ -e /var/run/sesman.pid ]
then
rm /var/run/sesman.pid
fi
fi fi
# Cleanup : If xrdp isn't running, but the pid exists, erase it. # Cleanup : If xrdp isn't running, but the pid exists, erase it.
if [ "$xrdpup" == "" ] if [ "$xrdpup" == "" ]
then then
if [ -e /var/run/xrdp.pid ] ; then rm /var/run/xrdp.pid ; fi if [ -e /var/run/xrdp.pid ]
then
rm /var/run/xrdp.pid
fi
fi fi
} }
case "$1" in case "$1" in
start) start)
check_up check_up
if [ "$xrdpup" != "" ] if [ "$xrdpup" != "" ]
then then
echo "Xrdp is already loaded" echo "Xrdp is already loaded"
exit 1 exit 1
fi fi
if [ "$sesup" != "" ] if [ "$sesup" != "" ]
then then
echo "sesman is already loaded" echo "sesman is already loaded"
exit 1 exit 1
fi fi
xrdp_start xrdp_start
;; ;;
stop) stop)
check_up check_up
if [ "$xrdpup" == "" ] if [ "$xrdpup" == "" ]
then then
echo "xrdp is not loaded." echo "xrdp is not loaded."
fi fi
if [ "$sesup" == "" ] if [ "$sesup" == "" ]
then then
echo "sesman is not loaded." echo "sesman is not loaded."
fi fi
xrdp_stop xrdp_stop
;; ;;
force-reload|restart) force-reload|restart)
check_up check_up
echo "Restarting Xrdp ..." echo "Restarting Xrdp ..."
xrdp_stop xrdp_stop
while [ "$xrdpup" != "" ]; do while [ "$xrdpup" != "" ]; do
check_up check_up
sleep 1 sleep 1
done done
xrdp_start xrdp_start
;; ;;
*) *)
echo "Usage: xrdp_control.sh {start|stop|restart|force-reload}" echo "Usage: xrdp_control.sh {start|stop|restart|force-reload}"
exit 1 exit 1
esac esac
exit 0 exit 0

@ -1,7 +1,9 @@
#!/bin/sh #!/bin/bash
# this needs to be a bash script, the first line needs to be #!/bin/bash
# xrdp control script # xrdp control script
# same as xrdp_control.sh except the XRDP_DIR is /usr/lib/xrdp # same as xrdp_control.sh except the XRDP_DIR is /usr/lib/xrdp
# Written : 1-13-2006 - Mark Balliet - posicat@pobox.com # Written : 1-13-2006 - Mark Balliet - posicat@pobox.com
# maintaned by Jay Sorg
# chkconfig: 2345 11 89 # chkconfig: 2345 11 89
# description: starts xrdp # description: starts xrdp
@ -40,55 +42,61 @@ check_up () {
# Cleanup : If sesman isn't running, but the pid exists, erase it. # Cleanup : If sesman isn't running, but the pid exists, erase it.
if [ "$sesup" == "" ] if [ "$sesup" == "" ]
then then
if [ -e /var/run/sesman.pid ] ; then rm /var/run/sesman.pid ; fi if [ -e /var/run/sesman.pid ]
then
rm /var/run/sesman.pid
fi
fi fi
# Cleanup : If xrdp isn't running, but the pid exists, erase it. # Cleanup : If xrdp isn't running, but the pid exists, erase it.
if [ "$xrdpup" == "" ] if [ "$xrdpup" == "" ]
then then
if [ -e /var/run/xrdp.pid ] ; then rm /var/run/xrdp.pid ; fi if [ -e /var/run/xrdp.pid ]
then
rm /var/run/xrdp.pid
fi
fi fi
} }
case "$1" in case "$1" in
start) start)
check_up check_up
if [ "$xrdpup" != "" ] if [ "$xrdpup" != "" ]
then then
echo "Xrdp is already loaded" echo "Xrdp is already loaded"
exit 1 exit 1
fi fi
if [ "$sesup" != "" ] if [ "$sesup" != "" ]
then then
echo "sesman is already loaded" echo "sesman is already loaded"
exit 1 exit 1
fi fi
xrdp_start xrdp_start
;; ;;
stop) stop)
check_up check_up
if [ "$xrdpup" == "" ] if [ "$xrdpup" == "" ]
then then
echo "xrdp is not loaded." echo "xrdp is not loaded."
fi fi
if [ "$sesup" == "" ] if [ "$sesup" == "" ]
then then
echo "sesman is not loaded." echo "sesman is not loaded."
fi fi
xrdp_stop xrdp_stop
;; ;;
force-reload|restart) force-reload|restart)
check_up check_up
echo "Restarting Xrdp ..." echo "Restarting Xrdp ..."
xrdp_stop xrdp_stop
while [ "$xrdpup" != "" ]; do while [ "$xrdpup" != "" ]; do
check_up check_up
sleep 1 sleep 1
done done
xrdp_start xrdp_start
;; ;;
*) *)
echo "Usage: xrdp_control.sh {start|stop|restart|force-reload}" echo "Usage: xrdp_control.sh {start|stop|restart|force-reload}"
exit 1 exit 1
esac esac
exit 0 exit 0

Loading…
Cancel
Save