diff --git a/installer/resources/i2prouter b/installer/resources/i2prouter
index ec86420d0ff853b5973798633e898a4da13e1b0a..482326303d93c163a4811ad6beb8d07d4d76bbda 100644
--- a/installer/resources/i2prouter
+++ b/installer/resources/i2prouter
@@ -126,7 +126,7 @@ getpid() {
             if [ "X$pid" != "X" ]
             then
                 # Verify that a process with this pid is still running.
-                pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1`
+                pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -n 1`
                 if [ "X$pid" = "X" ]
                 then
                     # This is a stale pid file.
@@ -142,7 +142,7 @@ getpid() {
 }
 
 testpid() {
-    pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1`
+    pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -n 1`
     if [ "X$pid" = "X" ]
     then
         # Process is gone so remove the pid file.