blob: 282d6f0ad267912939e0809b246c021cb7dc436a [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001From 79034f969bbd12215d65b4337dfd38a13d02d4ef Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Sat, 13 Sep 2014 20:19:28 -0700
4Subject: [PATCH] autofs.init.in: remove bashism
5
6It can work without the bashism.
7
8Upstream-Status: Pending
9
10Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
11Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
12---
13 redhat/autofs.init.in | 12 ++++++------
14 samples/rc.autofs.in | 10 +++++-----
15 2 files changed, 11 insertions(+), 11 deletions(-)
16
17diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in
18index 9d008ff..4f1c0d8 100644
19--- a/redhat/autofs.init.in
20+++ b/redhat/autofs.init.in
21@@ -1,4 +1,4 @@
22-#!/bin/bash
23+#!/bin/sh
24 #
25 # rc file for automount using a Sun-style "master map".
26 #
27@@ -42,7 +42,7 @@ if [ -r $confdir/autofs ]; then
28 . $confdir/autofs
29 fi
30
31-function start() {
32+start() {
33 # Make sure autofs4 module is loaded
34 if ! grep -q autofs /proc/filesystems
35 then
36@@ -102,7 +102,7 @@ function start() {
37 return $RETVAL
38 }
39
40-function stop() {
41+stop() {
42 echo -n $"Stopping $prog: "
43 count=0
44 while [ -n "`pidof $prog`" -a $count -lt 15 ] ; do
45@@ -125,7 +125,7 @@ function stop() {
46 return $RETVAL
47 }
48
49-function restart() {
50+restart() {
51 status autofs > /dev/null 2>&1
52 if [ $? -eq 0 ]; then
53 stop
54@@ -143,7 +143,7 @@ function restart() {
55 start
56 }
57
58-function reload() {
59+reload() {
60 if [ ! -f /var/lock/subsys/autofs ]; then
61 echo $"$prog not running"
62 RETVAL=1
63@@ -161,7 +161,7 @@ function reload() {
64 return $RETVAL
65 }
66
67-function usage_message() {
68+usage_message() {
69 echo $"Usage: $0 {start|forcestart|stop|status|restart|force-reload|forcerestart|reload|condrestart|try-restart|usage}"
70 }
71
72diff --git a/samples/rc.autofs.in b/samples/rc.autofs.in
73index 487669f..e96cde1 100644
74--- a/samples/rc.autofs.in
75+++ b/samples/rc.autofs.in
76@@ -1,4 +1,4 @@
77-#!/bin/bash
78+#!/bin/sh
79 #
80 # rc file for automount using a Sun-style "master map".
81 #
82@@ -36,7 +36,7 @@ if [ -r $confdir/autofs ]; then
83 . $confdir/autofs
84 fi
85
86-function start() {
87+start() {
88 echo -n "Starting $prog: "
89
90 # Make sure autofs4 module is loaded
91@@ -85,7 +85,7 @@ function start() {
92 return $RETVAL
93 }
94
95-function stop() {
96+stop() {
97 echo -n $"Stopping $prog: "
98 count=0
99 while [ -n "`pidof $prog`" -a $count -lt 15 ] ; do
100@@ -102,7 +102,7 @@ function stop() {
101 return $RETVAL
102 }
103
104-function restart() {
105+restart() {
106 stop
107 while [ -n "`pidof $prog`" ] ; do
108 sleep 5
109@@ -110,7 +110,7 @@ function restart() {
110 start
111 }
112
113-function reload() {
114+reload() {
115 pid=`pidof $prog`
116 if [ -z $pid ]; then
117 echo $"$prog not running"
118--
1191.7.9.5
120