]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
portmap: /etc/init.d/portmap restart complains "command not found"
authorAmy Fong <amy.fong@windriver.com>
Wed, 25 Jul 2012 15:53:42 +0000 (15:53 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 30 May 2013 19:58:54 +0000 (20:58 +0100)
portmap splits pmap_dump and pmap_set into a different package:
portmap_utils. Since this package might not be installed, I introduce
another init file that tests for the existance of these apps before trying
to run the pmap_* commands.

Signed-off-by: Amy Fong <amy.fong@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-connectivity/portmap/portmap/portmap.init

index e46513e1153425701f2e1fe0551702095770baea..621aa171ae6fddf8e09cdae19ee5e2b6cca371d4 100755 (executable)
@@ -40,14 +40,22 @@ case "$1" in
         $0 restart
        ;;
     restart)
-       pmap_dump >/var/run/portmap.state
+       # pmap_dump and pmap_set may be in a different package and not installed...
+       if [ -f /sbin/pmap_dump -a -f /sbin/pmap_set ]; then
+               do_state=1
+       else
+               do_state=0
+       fi
+       [ $do_state -eq 1 ] && pmap_dump >/var/run/portmap.state
         $0 stop
         $0 start
-       if [ ! -f /var/run/portmap.upgrade-state ]; then
-          sleep 1
-         pmap_set </var/run/portmap.state
+       if [ $do_state -eq 1 ]; then
+         if [ ! -f /var/run/portmap.upgrade-state ]; then
+            sleep 1
+           pmap_set </var/run/portmap.state
+         fi
+         rm -f /var/run/portmap.state
        fi
-       rm -f /var/run/portmap.state
        ;;
     *)
        echo "Usage: /etc/init.d/portmap {start|stop|reload|restart}"