Commit 0f75b263 authored by Maxime Hadjinlian's avatar Maxime Hadjinlian Committed by Peter Korsgaard
Browse files

package: Replace 'echo -n' by 'printf'



'echo -n' is not a POSIX construct (no flag support), we shoud use
'printf', especially in init script.

This patch was generated by the following command line:
git grep -l 'echo -n' -- `git ls-files | grep -v 'patch'` | xargs sed -i 's/echo -n/printf/'

Signed-off-by: default avatarMaxime Hadjinlian <maxime.hadjinlian@gmail.com>
Reviewed-by: default avatarArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: default avatarPeter Korsgaard <peter@korsgaard.com>
parent 60be8091
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2,12 +2,12 @@

case "$1" in
	start)
		echo -n "Starting acpid: "
		printf "Starting acpid: "
		start-stop-daemon -S -q -m -b -p /var/run/acpid.pid --exec /usr/sbin/acpid -- -n
		[ $? = 0 ] && echo "OK" || echo "FAIL"
		;;
	stop)
		echo -n "Stopping acpid: "
		printf "Stopping acpid: "
		start-stop-daemon -K -q -p /var/run/acpid.pid
		[ $? = 0 ] && echo "OK" || echo "FAIL"
		;;
+2 −2
Original line number Diff line number Diff line
@@ -6,12 +6,12 @@
umask 077

start() {
	echo -n "Starting atd: "
	printf "Starting atd: "
	start-stop-daemon --start --quiet --make-pidfile --pidfile /var/run/atd.pid --background --exec /usr/sbin/atd -- -f
	echo "OK"
}
stop() {
	echo -n "Stopping atd: "
	printf "Stopping atd: "
	start-stop-daemon --stop --quiet --pidfile /var/run/atd.pid
	echo "OK"
}
+4 −4
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ CONFIG=/etc/audit/auditd.conf
PIDFILE=/var/run/${NAME}.pid

start(){
	echo -n "Starting ${NAME}: "
	printf "Starting ${NAME}: "

	# Create dir to store log files in if one doesn't exist. Create
	# the directory with SELinux permissions if possible
@@ -38,20 +38,20 @@ start(){
}

stop(){
	echo -n "Stopping ${NAME}: "
	printf "Stopping ${NAME}: "

	start-stop-daemon -K -q -p ${PIDFILE}
	[ $? = 0 ] && echo "OK" || echo "FAIL"
}

reload(){
	echo -n "Reloading ${NAME} configuration: "
	printf "Reloading ${NAME} configuration: "
	start-stop-daemon --stop -s 1 -p ${PIDFILE} 1>/dev/null
	[ $? = 0 ] && echo "OK" || echo "FAIL"
}

rotate(){
	echo -n "Rotating ${NAME} logs: "
	printf "Rotating ${NAME} logs: "
	start-stop-daemon --stop -s 10 -p ${PIDFILE} 1>/dev/null
	[ $? = 0 ] && echo "OK" || echo "FAIL"
}
+3 −3
Original line number Diff line number Diff line
@@ -9,17 +9,17 @@ DAEMON=/usr/sbin/named
case "$1" in
	start)
		if [ ! -f /etc/rndc.key ]; then
		    echo -n "Initializing bind control key: "
		    printf "Initializing bind control key: "
                    # if rndc.key is a symlink, the target must exist
		    touch /etc/rndc.key
		    rndc-confgen -a -r /dev/urandom 2>/dev/null && echo "OK" || echo "FAIL"
		fi
		echo -n "Starting domain name daemon: "
		printf "Starting domain name daemon: "
		start-stop-daemon -S -x $DAEMON -- -c $CONFIG -u named
		[ $? = 0 ] && echo "OK" || echo "FAIL"
		;;
	stop)
		echo -n "Stopping domain name daemon: "
		printf "Stopping domain name daemon: "
		rndc stop || start-stop-daemon -K -x $DAEMON
		[ $? = 0 ] && echo "OK" || echo "FAIL"
		;;
+2 −2
Original line number Diff line number Diff line
@@ -4,14 +4,14 @@
#

start() {
	echo -n "Starting logging: "
	printf "Starting logging: "
	start-stop-daemon -b -S -q -m -p /var/run/syslogd.pid --exec /sbin/syslogd -- -n
	start-stop-daemon -b -S -q -m -p /var/run/klogd.pid --exec /sbin/klogd -- -n
	echo "OK"
}

stop() {
	echo -n "Stopping logging: "
	printf "Stopping logging: "
	start-stop-daemon -K -q -p /var/run/syslogd.pid
	start-stop-daemon -K -q -p /var/run/klogd.pid
	echo "OK"
Loading