1 | 1 |
deleted file mode 100755 |
... | ... |
@@ -1,33 +0,0 @@ |
1 |
-#!/sbin/runscript |
|
2 |
-# Copyright 2002 Frauenhofer Gesellschaft FOKUS, Germany. |
|
3 |
-# Distributed under the terms of the GNU General Public License, v2 or later |
|
4 |
-# $Header$ |
|
5 |
- |
|
6 |
-depend() { |
|
7 |
- need net |
|
8 |
-} |
|
9 |
- |
|
10 |
-check_config() { |
|
11 |
- out=`(/usr/sbin/ser -c > /dev/null || true) 2>&1` |
|
12 |
- echo "$out" | grep -q 'config file ok, exiting...' |
|
13 |
- if [ "$?" == 1 ]; then |
|
14 |
- echo -e "There are errors in the configuration. Please fix them first" |
|
15 |
- echo -e "\n$out\n" |
|
16 |
- return 1 |
|
17 |
- fi |
|
18 |
-} |
|
19 |
- |
|
20 |
-start() { |
|
21 |
- check_config || return 1 |
|
22 |
- ebegin "Starting ser" |
|
23 |
- start-stop-daemon --start --quiet --pidfile /var/run/ser.pid \ |
|
24 |
- --exec /usr/sbin/ser -- -P /var/run/ser.pid |
|
25 |
- eend $? |
|
26 |
-} |
|
27 |
- |
|
28 |
-stop() { |
|
29 |
- ebegin "Stopping ser" |
|
30 |
- start-stop-daemon --stop --quiet --pidfile /var/run/ser.pid |
|
31 |
- eend $? |
|
32 |
-} |
|
33 |
- |
... | ... |
@@ -7,7 +7,18 @@ depend() { |
7 | 7 |
need net |
8 | 8 |
} |
9 | 9 |
|
10 |
+check_config() { |
|
11 |
+ out=`(/usr/sbin/ser -c > /dev/null || true) 2>&1` |
|
12 |
+ echo "$out" | grep -q 'config file ok, exiting...' |
|
13 |
+ if [ "$?" == 1 ]; then |
|
14 |
+ echo -e "There are errors in the configuration. Please fix them first" |
|
15 |
+ echo -e "\n$out\n" |
|
16 |
+ return 1 |
|
17 |
+ fi |
|
18 |
+} |
|
19 |
+ |
|
10 | 20 |
start() { |
21 |
+ check_config || return 1 |
|
11 | 22 |
ebegin "Starting ser" |
12 | 23 |
start-stop-daemon --start --quiet --pidfile /var/run/ser.pid \ |
13 | 24 |
--exec /usr/sbin/ser -- -P /var/run/ser.pid |
1 | 1 |
new file mode 100755 |
... | ... |
@@ -0,0 +1,22 @@ |
1 |
+#!/sbin/runscript |
|
2 |
+# Copyright 1999-2002 Gentoo Technologies, Inc. |
|
3 |
+# Distributed under the terms of the GNU General Public License, v2 or later |
|
4 |
+# $Header$ |
|
5 |
+ |
|
6 |
+depend() { |
|
7 |
+ need net |
|
8 |
+} |
|
9 |
+ |
|
10 |
+start() { |
|
11 |
+ ebegin "Starting ser" |
|
12 |
+ start-stop-daemon --start --quiet --pidfile /var/run/ser.pid \ |
|
13 |
+ --exec /usr/sbin/ser -- -P /var/run/ser.pid |
|
14 |
+ eend $? |
|
15 |
+} |
|
16 |
+ |
|
17 |
+stop() { |
|
18 |
+ ebegin "Stopping ser" |
|
19 |
+ start-stop-daemon --stop --quiet --pidfile /var/run/ser.pid |
|
20 |
+ eend $? |
|
21 |
+} |
|
22 |
+ |