This is a common error and the reason is your are using Windows to create the file. Thus the line break is \r\n rather than \n.
All you need to do is change the format using a system command:
dos2unix filename_here
An innovative, experienced solutions architect with strong focus on public cloud architecture, solution design and leading technical team. Zhen has 15 years experience designing and implementing a wide spectrum of enterprise level solutions. In the last 4 years, he is committed to evangelising Azure, DevOps and Scrum. His recent focus are enterprise digitisation, cloud governance, reference architecture, IoT, Big Data, Microservices, AWS.
This is a common error and the reason is your are using Windows to create the file. Thus the line break is \r\n rather than \n.
All you need to do is change the format using a system command:
dos2unix filename_here
#!/bin/sh
#
# description: usbMountWrapper is the daemon to xxxxxx
#
. /etc/rc.d/init.d/functions
function start()
{
printf "Starting %s: " "usbMountWrapper"
daemon /opt/smebackup/usbMountWrapper &
echo
touch /var/lock/subsys/usbMountWrapper
}
function stop()
{
printf "Stopping %s: " "usbMountWrapper"
killproc usbMountWrapper
echo
rm -f /var/lock/subsys/usbMountWrapper
}
function reload()
{
pid=`pidof ulogd`
if [ "x$pid" != "x" ]; then
kill -HUP $pid 2>/dev/null
fi
touch /var/lock/subsys/usbMountWrapper
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
reload)
reload
;;
status)
status usbMountWrapper
;;
*)
printf "Usage: %s {start|stop|status|restart|reload}\n" "usbMountWrapper"
exit 1
esac
exit 0