[etherlab-users] master startup script uses bashisms

Florian Pose fp at igh-essen.com
Mon Dec 29 12:19:18 CET 2008


Hi,

On Wed, Dec 17, 2008 at 03:11:17PM +0100, martin troxler wrote:
> the ethercat startup script /etc/init.d/ethercat uses the 'function'
> keyword which is a feature supported only by the bash.
> 
> 
> Since Ubuntu uses the dash as default shell (to improve the boot
> process, see https://wiki.ubuntu.com/DashAsBinSh) I suggest to either 
> - remove the 'function' keyword
> or
> - mark the script as a bash script (#/bin/bash)

I think the first solution is the better one, because the
bash-dependency is a policy. I figured out, that the function keyword
can be easily dropped. Could you try the attached patch?

-- 
Best regards,
Florian Pose

http://etherlab.org
-------------- next part --------------
Index: script/init.d/ethercat.in
===================================================================
--- script/init.d/ethercat.in	(Revision 1597)
+++ script/init.d/ethercat.in	(Arbeitskopie)
@@ -71,8 +71,7 @@
 
 #------------------------------------------------------------------------------
 
-function exit_success()
-{
+exit_success() {
     if [ -r /etc/rc.status ]; then
         rc_reset
         rc_status -v
@@ -85,8 +84,7 @@
 
 #------------------------------------------------------------------------------
 
-function exit_fail()
-{
+exit_fail() {
     if [ -r /etc/rc.status ]; then
         rc_failed
         rc_status -v
@@ -99,8 +97,7 @@
 
 #------------------------------------------------------------------------------
 
-function print_running()
-{
+print_running() {
     if [ -r /etc/rc.status ]; then
         rc_reset
         rc_status -v
@@ -111,8 +108,7 @@
 
 #------------------------------------------------------------------------------
 
-function print_dead()
-{
+print_dead() {
     if [ -r /etc/rc.status ]; then
         rc_failed
         rc_status -v
@@ -123,8 +119,7 @@
 
 #------------------------------------------------------------------------------
 
-function parse_mac_address()
-{
+parse_mac_address() {
     if [ -z "${1}" ]; then
         MAC=""
     elif echo ${1} | grep -qE '^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$'; then


More information about the Etherlab-users mailing list