Browse code

etc: cleaned up folder, moving unused files to examples

Daniel-Constantin Mierla authored on 14/03/2014 18:59:02
Showing 1 changed files
1 1
deleted file mode 100755
... ...
@@ -1,225 +0,0 @@
1
-#!/bin/sh
2
-#
3
-# 3w-xxxx:      Starts the sip2jab process
4
-#
5
-# Version:      @(#) /etc/rc.d/init.d/3w-xxxx
6
-#
7
-# chkconfig: 2345 85 15
8
-# description: controls execution of SIP2Jabber gateway
9
-
10
-# JABBER
11
-JDIR="/home/sms/jabber-1.4.2"
12
-JABBERD="${JDIR}/jabberd/jabberd"
13
-JICQEXT="${JDIR}/icqv7ext.sh"
14
-CONF="${JDIR}/conf/single.xml"
15
-JUSR="sms"
16
-JPID="${JDIR}/spool/jabbers.pid"
17
-JOUT="${JDIR}/spool/jabberd.log"
18
-
19
-# SER
20
-BIN=imgw
21
-HM=/home/sms/srouter
22
-BINDIR=$HM/bin
23
-ETC=$HM/sip_router/etc/imgw.cfg
24
-USR="sms"
25
-GRP="sms"
26
-MYDIR=$HM/core
27
-CORE=$MYDIR/core
28
-
29
-RETVAL=0
30
-
31
-############ ==== #############
32
-
33
-# Test if Jabber exists
34
-test -f ${JABBERD} -a -f ${CONF} || exit 0
35
-
36
-# Source function library.
37
-. /etc/rc.d/init.d/functions
38
-
39
-# Get config.
40
-. /etc/sysconfig/network
41
-
42
-# Check that networking is up.
43
-[ "${NETWORKING}" = "no" ] && exit 0
44
-
45
-# Current user
46
-CRT_USER=`whoami`
47
-
48
-### Stop Jabber server
49
-stop_jab() {
50
-	echo "Stopping ICQ transport - external component ..."
51
-	killproc ${JICQEXT}
52
-	# echo
53
-	echo "Stopping Jabber server ..."
54
-	killproc ${JABBERD}
55
-	RETVAL=$? 
56
-	# echo
57
-	# kill `cat ${JPID}`
58
-	# echo " OK."
59
-}
60
-
61
-### Start Jabber server
62
-start_jab() {
63
-	if [ -f ${JPID} ]
64
-	then
65
-		echo "Cleaning Jabber from a previous dirty crash ..."
66
-		stop_jab
67
-		sleep 1
68
-		rm -f ${JPID}
69
-	fi
70
-
71
-	if [ `id -u` = 0 ]
72
-	then
73
-		#### Run by root
74
-		echo "Starting Jabber server ..."
75
-		su - ${JUSR} -c "cd ${JDIR}; ${JABBERD} -B -c ${CONF} > /dev/null 2>&1"  > /dev/null 2>&1
76
-		# echo
77
-		sleep 2
78
-		echo "Starting ICQ transport - external component ..."
79
-		su - ${JUSR} -c "cd ${JDIR}; ${JICQEXT} > /dev/null 2>&1 &" > /dev/null 2>&1
80
-		RETVAL=$? 
81
-		# echo
82
-	else
83
-		### Run by other users
84
-		echo "Starting Jabber server ..."
85
-		cd ${JDIR}
86
-		${JABBERD} -B -c ${CONF} > /dev/null 2>&1
87
-		# echo
88
-		sleep 2
89
-		echo "Starting ICQ transport - external component ..."
90
-		${JICQEXT} > /dev/null 2>&1 &
91
-		RETVAL=$?
92
-		# echo
93
-	fi
94
-	
95
-	sleep 1
96
-	### Checking if processes are started
97
-	if [ `ps auxw | grep ${JABBERD} | head --lines=1 | awk '{print $11}'` = ${JABBERD} ]
98
-	then
99
-		echo "Jabber server:           [[   STARTED   ]]"
100
-	else
101
-		echo "Jabber server:           [[ NOT STARTED ]]"
102
-	fi
103
-	if [ `ps auxw | grep ${JICQEXT} | head --lines=1 | awk '{print $11}'` != "grep" ]
104
-	then
105
-		echo "ICQ transport:           [[   STARTED   ]]"
106
-	else
107
-		echo "ICQ transport:           [[ NOT STARTED ]]"
108
-	fi
109
-}
110
-
111
-### Stop SER
112
-stop_ser() {
113
-	echo -n "Stopping SIP router ..."
114
-	killproc ${BIN}
115
-	RETVAL=$?
116
-	echo
117
-	# killall ser
118
-	# echo " [ OK ]"
119
-}
120
-
121
-### Start SER
122
-start_ser() {
123
-	echo "Starting SIP router ..."
124
-	if [ `id -u` = 0 ]
125
-	then
126
-		#### Run by root
127
-		echo "- ${USR} -c cd ${MYDIR}; ${BINDIR}/${BIN} -f ${ETC} -w ${MYDIR}  > /dev/null 2>&1"
128
-		su - ${USR} -c "cd ${MYDIR}; ${BINDIR}/${BIN} -f ${ETC} -w ${MYDIR}"  > /dev/null 2>&1
129
-		RETVAL=$?
130
-	else
131
-		#### Run by other users
132
-		#cd $MYDIR
133
-
134
-		# core timestamping moved to sercheck; -jiri
135
-		#	if [ -f $CORE ] ; then
136
-		#		chmod a+r $CORE
137
-		#		DATE=`date "+%Y-%m-%d--%H-%M"`
138
-		#		mv $CORE $CORE.$DATE
139
-		#		( cd ../sip_router; tar cf - . ) | gzip > ser.$DATE.tgz
140
-		#	fi
141
-
142
-		cd ${MYDIR}
143
-		${BINDIR}/${BIN} -f ${ETC} -w ${MYDIR}
144
-		RETVAL=$?
145
-
146
-		# man setuid: If uid is different from the old effective uid,
147
-		# the process will be forbidden from eaving core dumps.
148
-		# -> don't set uid, we want to collect core dumps
149
-		# -u $USR -g $GRP
150
-	fi
151
-
152
-	sleep 1
153
-	### Checking if processes are started
154
-	if [ `ps auxw | grep ${BINDIR}/${BIN} | head --lines=1 | awk '{print $11}'` = ${BINDIR}/${BIN} ]
155
-	then
156
-		echo "SIP router:              [[   STARTED   ]]"
157
-	else
158
-		echo "SIP router:              [[ NOT STARTED ]]"
159
-	fi
160
-}
161
-
162
-### Check
163
-check_run() {
164
-	### Checking if Jabber server is running
165
-	if [ `ps auxw | grep ${JABBERD} | head --lines=1 | awk '{print $11}'` = ${JABBERD} ]
166
-	then
167
-		echo "Jabber server:           [[   RUNNING   ]]"
168
-	else
169
-		echo "Jabber server:           [[ NOT RUNNING ]]"
170
-	fi
171
-	### Checking if ICQ transport is running
172
-	if [ `ps auxw | grep ${JICQEXT} | head --lines=1 | awk '{print $11}'` != "grep" ]
173
-	then
174
-		echo "ICQ transport:           [[   RUNNING   ]]"
175
-	else
176
-		echo "ICQ transport:           [[ NOT RUNNING ]]"
177
-	fi
178
-	### Checking if SIP router is running
179
-	if [ `ps auxw | grep ${BINDIR}/${BIN} | head --lines=1 | awk '{print $11}'` = ${BINDIR}/${BIN} ]
180
-	then
181
-		echo "SIP router:              [[   RUNNING   ]]"
182
-	else
183
-		echo "SIP router:              [[ NOT RUNNING ]]"
184
-	fi
185
-}
186
-
187
-### Cleaning
188
-make_clean() {
189
-    sleep 2
190
-    echo "Cleaning Jabber core if generated on killing ..."
191
-    rm -f ${JDIR}/core.*
192
-}
193
-	    
194
-case "$1" in
195
-	start)
196
-		start_jab
197
-		start_ser
198
-	;;
199
-	stop)
200
-		stop_ser
201
-		stop_jab
202
-		sleep 2
203
-		make_clean
204
-	;;
205
-	restart)
206
-		echo "Restarting SIP2Jabber ..."
207
-		stop_ser
208
-		stop_jab
209
-		sleep 2
210
-		echo
211
-		start_jab
212
-		start_ser
213
-		make_clean
214
-	;;
215
-	check)
216
-		check_run
217
-	;;
218
-	*)
219
-		N=$0
220
-		echo "Usage: $N {start|stop|restart|check}" >&2
221
-		exit 1
222
-	;;
223
-esac
224
-echo
225
-exit $RETVAL
Browse code

*** empty log message ***

Daniel-Constantin Mierla authored on 26/07/2002 16:38:05
Showing 1 changed files
... ...
@@ -4,12 +4,8 @@
4 4
 #
5 5
 # Version:      @(#) /etc/rc.d/init.d/3w-xxxx
6 6
 #
7
-# chkconfig: 2345 20 85
7
+# chkconfig: 2345 85 15
8 8
 # description: controls execution of SIP2Jabber gateway
9
-# processname: sip2jab
10
-# config: /etc/use_jabs.cfg
11
-
12
-# User "dcm" is used if is the script is run by root
13 9
 
14 10
 # JABBER
15 11
 JDIR="/home/sms/jabber-1.4.2"
Browse code

init.d script for starting/stopping IM Gateway

Daniel-Constantin Mierla authored on 18/07/2002 11:50:17
Showing 1 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,229 @@
1
+#!/bin/sh
2
+#
3
+# 3w-xxxx:      Starts the sip2jab process
4
+#
5
+# Version:      @(#) /etc/rc.d/init.d/3w-xxxx
6
+#
7
+# chkconfig: 2345 20 85
8
+# description: controls execution of SIP2Jabber gateway
9
+# processname: sip2jab
10
+# config: /etc/use_jabs.cfg
11
+
12
+# User "dcm" is used if is the script is run by root
13
+
14
+# JABBER
15
+JDIR="/home/sms/jabber-1.4.2"
16
+JABBERD="${JDIR}/jabberd/jabberd"
17
+JICQEXT="${JDIR}/icqv7ext.sh"
18
+CONF="${JDIR}/conf/single.xml"
19
+JUSR="sms"
20
+JPID="${JDIR}/spool/jabbers.pid"
21
+JOUT="${JDIR}/spool/jabberd.log"
22
+
23
+# SER
24
+BIN=imgw
25
+HM=/home/sms/srouter
26
+BINDIR=$HM/bin
27
+ETC=$HM/sip_router/etc/imgw.cfg
28
+USR="sms"
29
+GRP="sms"
30
+MYDIR=$HM/core
31
+CORE=$MYDIR/core
32
+
33
+RETVAL=0
34
+
35
+############ ==== #############
36
+
37
+# Test if Jabber exists
38
+test -f ${JABBERD} -a -f ${CONF} || exit 0
39
+
40
+# Source function library.
41
+. /etc/rc.d/init.d/functions
42
+
43
+# Get config.
44
+. /etc/sysconfig/network
45
+
46
+# Check that networking is up.
47
+[ "${NETWORKING}" = "no" ] && exit 0
48
+
49
+# Current user
50
+CRT_USER=`whoami`
51
+
52
+### Stop Jabber server
53
+stop_jab() {
54
+	echo "Stopping ICQ transport - external component ..."
55
+	killproc ${JICQEXT}
56
+	# echo
57
+	echo "Stopping Jabber server ..."
58
+	killproc ${JABBERD}
59
+	RETVAL=$? 
60
+	# echo
61
+	# kill `cat ${JPID}`
62
+	# echo " OK."
63
+}
64
+
65
+### Start Jabber server
66
+start_jab() {
67
+	if [ -f ${JPID} ]
68
+	then
69
+		echo "Cleaning Jabber from a previous dirty crash ..."
70
+		stop_jab
71
+		sleep 1
72
+		rm -f ${JPID}
73
+	fi
74
+
75
+	if [ `id -u` = 0 ]
76
+	then
77
+		#### Run by root
78
+		echo "Starting Jabber server ..."
79
+		su - ${JUSR} -c "cd ${JDIR}; ${JABBERD} -B -c ${CONF} > /dev/null 2>&1"  > /dev/null 2>&1
80
+		# echo
81
+		sleep 2
82
+		echo "Starting ICQ transport - external component ..."
83
+		su - ${JUSR} -c "cd ${JDIR}; ${JICQEXT} > /dev/null 2>&1 &" > /dev/null 2>&1
84
+		RETVAL=$? 
85
+		# echo
86
+	else
87
+		### Run by other users
88
+		echo "Starting Jabber server ..."
89
+		cd ${JDIR}
90
+		${JABBERD} -B -c ${CONF} > /dev/null 2>&1
91
+		# echo
92
+		sleep 2
93
+		echo "Starting ICQ transport - external component ..."
94
+		${JICQEXT} > /dev/null 2>&1 &
95
+		RETVAL=$?
96
+		# echo
97
+	fi
98
+	
99
+	sleep 1
100
+	### Checking if processes are started
101
+	if [ `ps auxw | grep ${JABBERD} | head --lines=1 | awk '{print $11}'` = ${JABBERD} ]
102
+	then
103
+		echo "Jabber server:           [[   STARTED   ]]"
104
+	else
105
+		echo "Jabber server:           [[ NOT STARTED ]]"
106
+	fi
107
+	if [ `ps auxw | grep ${JICQEXT} | head --lines=1 | awk '{print $11}'` != "grep" ]
108
+	then
109
+		echo "ICQ transport:           [[   STARTED   ]]"
110
+	else
111
+		echo "ICQ transport:           [[ NOT STARTED ]]"
112
+	fi
113
+}
114
+
115
+### Stop SER
116
+stop_ser() {
117
+	echo -n "Stopping SIP router ..."
118
+	killproc ${BIN}
119
+	RETVAL=$?
120
+	echo
121
+	# killall ser
122
+	# echo " [ OK ]"
123
+}
124
+
125
+### Start SER
126
+start_ser() {
127
+	echo "Starting SIP router ..."
128
+	if [ `id -u` = 0 ]
129
+	then
130
+		#### Run by root
131
+		echo "- ${USR} -c cd ${MYDIR}; ${BINDIR}/${BIN} -f ${ETC} -w ${MYDIR}  > /dev/null 2>&1"
132
+		su - ${USR} -c "cd ${MYDIR}; ${BINDIR}/${BIN} -f ${ETC} -w ${MYDIR}"  > /dev/null 2>&1
133
+		RETVAL=$?
134
+	else
135
+		#### Run by other users
136
+		#cd $MYDIR
137
+
138
+		# core timestamping moved to sercheck; -jiri
139
+		#	if [ -f $CORE ] ; then
140
+		#		chmod a+r $CORE
141
+		#		DATE=`date "+%Y-%m-%d--%H-%M"`
142
+		#		mv $CORE $CORE.$DATE
143
+		#		( cd ../sip_router; tar cf - . ) | gzip > ser.$DATE.tgz
144
+		#	fi
145
+
146
+		cd ${MYDIR}
147
+		${BINDIR}/${BIN} -f ${ETC} -w ${MYDIR}
148
+		RETVAL=$?
149
+
150
+		# man setuid: If uid is different from the old effective uid,
151
+		# the process will be forbidden from eaving core dumps.
152
+		# -> don't set uid, we want to collect core dumps
153
+		# -u $USR -g $GRP
154
+	fi
155
+
156
+	sleep 1
157
+	### Checking if processes are started
158
+	if [ `ps auxw | grep ${BINDIR}/${BIN} | head --lines=1 | awk '{print $11}'` = ${BINDIR}/${BIN} ]
159
+	then
160
+		echo "SIP router:              [[   STARTED   ]]"
161
+	else
162
+		echo "SIP router:              [[ NOT STARTED ]]"
163
+	fi
164
+}
165
+
166
+### Check
167
+check_run() {
168
+	### Checking if Jabber server is running
169
+	if [ `ps auxw | grep ${JABBERD} | head --lines=1 | awk '{print $11}'` = ${JABBERD} ]
170
+	then
171
+		echo "Jabber server:           [[   RUNNING   ]]"
172
+	else
173
+		echo "Jabber server:           [[ NOT RUNNING ]]"
174
+	fi
175
+	### Checking if ICQ transport is running
176
+	if [ `ps auxw | grep ${JICQEXT} | head --lines=1 | awk '{print $11}'` != "grep" ]
177
+	then
178
+		echo "ICQ transport:           [[   RUNNING   ]]"
179
+	else
180
+		echo "ICQ transport:           [[ NOT RUNNING ]]"
181
+	fi
182
+	### Checking if SIP router is running
183
+	if [ `ps auxw | grep ${BINDIR}/${BIN} | head --lines=1 | awk '{print $11}'` = ${BINDIR}/${BIN} ]
184
+	then
185
+		echo "SIP router:              [[   RUNNING   ]]"
186
+	else
187
+		echo "SIP router:              [[ NOT RUNNING ]]"
188
+	fi
189
+}
190
+
191
+### Cleaning
192
+make_clean() {
193
+    sleep 2
194
+    echo "Cleaning Jabber core if generated on killing ..."
195
+    rm -f ${JDIR}/core.*
196
+}
197
+	    
198
+case "$1" in
199
+	start)
200
+		start_jab
201
+		start_ser
202
+	;;
203
+	stop)
204
+		stop_ser
205
+		stop_jab
206
+		sleep 2
207
+		make_clean
208
+	;;
209
+	restart)
210
+		echo "Restarting SIP2Jabber ..."
211
+		stop_ser
212
+		stop_jab
213
+		sleep 2
214
+		echo
215
+		start_jab
216
+		start_ser
217
+		make_clean
218
+	;;
219
+	check)
220
+		check_run
221
+	;;
222
+	*)
223
+		N=$0
224
+		echo "Usage: $N {start|stop|restart|check}" >&2
225
+		exit 1
226
+	;;
227
+esac
228
+echo
229
+exit $RETVAL