summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsorg71 <jsorg71>2008-04-30 04:38:17 +0000
committerjsorg71 <jsorg71>2008-04-30 04:38:17 +0000
commit59645cf8035642701d08c443cc487794ec75d3ac (patch)
tree2768e0022870824fe3ad158be52a4762ea9d292f
parent808ade37e8fc3ba51a30bbcf19a9d56d87ffa7be (diff)
downloadxrdp-proprietary-59645cf8035642701d08c443cc487794ec75d3ac.tar.gz
xrdp-proprietary-59645cf8035642701d08c443cc487794ec75d3ac.zip
rename xrdp_control.sh to xrdp
-rwxr-xr-xinstfiles/xrdp (renamed from instfiles/xrdp_control.sh)35
-rw-r--r--instfiles/xrdp_control1.sh146
2 files changed, 15 insertions, 166 deletions
diff --git a/instfiles/xrdp_control.sh b/instfiles/xrdp
index d5173150..8a1e9ae6 100755
--- a/instfiles/xrdp_control.sh
+++ b/instfiles/xrdp
@@ -5,35 +5,30 @@
# chkconfig: 2345 11 89
# description: starts xrdp
-XRDP=xrdp
-SESMAN=sesman
-STARTWM=startwm.sh
-XRDP_DIR=/usr/local/xrdp/
+SBINDIR=/usr/local/sbin
LOG=/dev/null
-cd $XRDP_DIR
-
-if ! test -x $XRDP
+if ! test -x $SBINDIR/xrdp
then
- echo "$XRDP is not executable"
+ echo "xrdp is not executable"
exit 0
fi
-if ! test -x $SESMAN
+if ! test -x $SBINDIR/xrdp-sesman
then
- echo "$SESMAN is not executable"
+ echo "xrdp-sesman is not executable"
exit 0
fi
-if ! test -x $STARTWM
+if ! test -x $CFGDIR/startwm.sh
then
- echo "$STARTWM is not executable"
+ echo "startwm.sh is not executable"
exit 0
fi
xrdp_start()
{
echo -n "Starting: xrdp and sesman . . "
- ./$XRDP >> $LOG
- ./$SESMAN >> $LOG
+ $SBINDIR/xrdp >> $LOG
+ $SBINDIR/xrdp-sesman >> $LOG
echo "."
sleep 1
return 0;
@@ -42,15 +37,15 @@ xrdp_start()
xrdp_stop()
{
echo -n "Stopping: xrdp and sesman . . "
- ./$SESMAN --kill >> $LOG
- ./$XRDP --kill >> $LOG
+ $SBINDIR/xrdp-sesman --kill >> $LOG
+ $SBINDIR/xrdp --kill >> $LOG
echo "."
return 0;
}
is_xrdp_running()
{
- ps u --noheading -C $XRDP | grep -q -i $XRDP
+ ps u --noheading -C xrdp | grep -q -i xrdp
if test $? -eq 0
then
return 1;
@@ -61,7 +56,7 @@ is_xrdp_running()
is_sesman_running()
{
- ps u --noheading -C $SESMAN | grep -q -i $SESMAN
+ ps u --noheading -C xrdp-sesman | grep -q -i xrdp-sesman
if test $? -eq 0
then
return 1;
@@ -76,9 +71,9 @@ check_up()
is_sesman_running
if test $? -eq 0
then
- if test -e /var/run/sesman.pid
+ if test -e /var/run/xrdp-sesman.pid
then
- rm /var/run/sesman.pid
+ rm /var/run/xrdp-sesman.pid
fi
fi
# Cleanup : If xrdp isn't running, but the pid exists, erase it.
diff --git a/instfiles/xrdp_control1.sh b/instfiles/xrdp_control1.sh
deleted file mode 100644
index 92805f99..00000000
--- a/instfiles/xrdp_control1.sh
+++ /dev/null
@@ -1,146 +0,0 @@
-#!/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
-# maintaned by Jay Sorg
-# chkconfig: 2345 11 89
-# description: starts xrdp
-
-XRDP=xrdp
-SESMAN=sesman
-STARTWM=startwm.sh
-XRDP_DIR=/usr/lib/xrdp/
-LOG=/dev/null
-
-cd $XRDP_DIR
-
-if ! test -x $XRDP
-then
- echo "$XRDP is not executable"
- exit 0
-fi
-if ! test -x $SESMAN
-then
- echo "$SESMAN is not executable"
- exit 0
-fi
-if ! test -x $STARTWM
-then
- echo "$STARTWM is not executable"
- exit 0
-fi
-
-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 "."
- return 0;
-}
-
-is_xrdp_running()
-{
- ps u --noheading -C $XRDP | grep -q -i $XRDP
- if test $? -eq 0
- then
- return 1;
- else
- return 0;
- fi
-}
-
-is_sesman_running()
-{
- ps u --noheading -C $SESMAN | grep -q -i $SESMAN
- if test $? -eq 0
- then
- return 1;
- else
- return 0;
- fi
-}
-
-check_up()
-{
- # Cleanup : If sesman isn't running, but the pid exists, erase it.
- is_sesman_running
- if test $? -eq 0
- then
- if test -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.
- is_xrdp_running
- if test $? -eq 0
- then
- if test -e /var/run/xrdp.pid
- then
- rm /var/run/xrdp.pid
- fi
- fi
- return 0;
-}
-
-case "$1" in
- start)
- check_up
- is_xrdp_running
- if ! test $? -eq 0
- then
- echo "xrdp is already loaded"
- exit 1
- fi
- is_sesman_running
- if ! test $? -eq 0
- then
- echo "sesman is already loaded"
- exit 1
- fi
- xrdp_start
- ;;
- stop)
- check_up
- is_xrdp_running
- if test $? -eq 0
- then
- echo "xrdp is not loaded."
- fi
- is_sesman_running
- if test $? -eq 0
- then
- echo "sesman is not loaded."
- fi
- xrdp_stop
- ;;
- force-reload|restart)
- check_up
- echo "Restarting xrdp ..."
- xrdp_stop
- is_xrdp_running
- while ! test $? -eq 0
- do
- check_up
- sleep 1
- is_xrdp_running
- done
- xrdp_start
- ;;
- *)
- echo "Usage: xrdp_control.sh {start|stop|restart|force-reload}"
- exit 1
-esac
-
-exit 0