summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsorg71 <jsorg71>2006-08-07 03:28:04 +0000
committerjsorg71 <jsorg71>2006-08-07 03:28:04 +0000
commitaac9f71e5b8c88e9946287d37fc3cbf98c3720ac (patch)
tree2c0fbb29024568ddb9655a28f1ad33d790545616
parentdb00895721733bedda826c67af96a8c35c6c9374 (diff)
downloadxrdp-proprietary-aac9f71e5b8c88e9946287d37fc3cbf98c3720ac.tar.gz
xrdp-proprietary-aac9f71e5b8c88e9946287d37fc3cbf98c3720ac.zip
added xrdp_control1.sh for package installs
-rw-r--r--instfiles/xrdp_control1.sh92
1 files changed, 92 insertions, 0 deletions
diff --git a/instfiles/xrdp_control1.sh b/instfiles/xrdp_control1.sh
new file mode 100644
index 00000000..4282de68
--- /dev/null
+++ b/instfiles/xrdp_control1.sh
@@ -0,0 +1,92 @@
+#!/bin/sh
+# xrdp control script
+# same as xrdp_control.sh except the XRDP_DIR is /usr/lib/xrdp
+# Written : 1-13-2006 - Mark Balliet - posicat@pobox.com
+
+XRDP=xrdp
+SESMAN=sesman
+STARTWM=startwm.sh
+XRDP_DIR=/usr/lib/xrdp/
+LOG=/dev/null
+
+cd $XRDP_DIR
+
+test -x $XRDP || (echo "$XRDP is not executable" ; exit 0)
+test -x $SESMAN || (echo "$SESMAN is not executable" ; exit 0)
+test -x $STARTWM || (echo "$STARTWM is not executable" ; exit 0)
+
+xrdp_start () {
+ echo -n "Starting : xrdp and sesman . . "
+ ./$XRDP >> $LOG
+ ./$SESMAN >> $LOG
+ echo "."
+ sleep 1
+ return 0
+}
+
+xrdp_stop () {
+ echo -n "Stopping : xrdp and sesman . . "
+ ./$SESMAN --kill >> $LOG
+ ./$XRDP --kill >> $LOG
+ echo "."
+}
+
+check_up () {
+ xrdpup=`ps u --noheading -C $XRDP`
+ sesup=`ps u --noheading -C $SESMAN`
+
+ # Cleanup : If sesman isn't running, but the pid exists, erase it.
+ if [ "$sesup" == "" ]
+ then
+ if [ -e /var/run/sesman.pid ] ; then rm /var/run/sesman.pid ; fi
+ fi
+ # Cleanup : If xrdp isn't running, but the pid exists, erase it.
+ if [ "$xrdpup" == "" ]
+ then
+ if [ -e /var/run/xrdp.pid ] ; then rm /var/run/xrdp.pid ; fi
+ fi
+}
+
+case "$1" in
+ start)
+ check_up
+ if [ "$xrdpup" != "" ]
+ then
+ echo "Xrdp is already loaded"
+ exit 1
+ fi
+ if [ "$sesup" != "" ]
+ then
+ echo "sesman is already loaded"
+ exit 1
+ fi
+ xrdp_start
+ ;;
+ stop)
+ check_up
+ if [ "$xrdpup" == "" ]
+ then
+ echo "xrdp is not loaded."
+ fi
+ if [ "$sesup" == "" ]
+ then
+ echo "sesman is not loaded."
+ fi
+ xrdp_stop
+ ;;
+ force-reload|restart)
+ check_up
+ echo "Restarting Xrdp ..."
+ xrdp_stop
+ while [ "$xrdpup" != "" ]; do
+ check_up
+ sleep 1
+ done
+ xrdp_start
+ ;;
+ *)
+ echo "Usage: xrdp_control.sh {start|stop|restart|force-reload}"
+ exit 1
+esac
+
+exit 0