diff --git net/ntopng/Makefile net/ntopng/Makefile
index c83b15c1382c..3e546dbce464 100644
--- net/ntopng/Makefile
+++ net/ntopng/Makefile
@@ -50,7 +50,8 @@ USE_RC_SUBR=	ntopng
 
 post-patch:
 	@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \
-		${WRKSRC}/configure.seed
+		${WRKSRC}/configure.seed \
+		${WRKSRC}/httpdocs/misc/ntopng-add-user.sh
 	cd ${WRKSRC} && ${SH} autogen.sh
 
 post-install:
diff --git net/ntopng/files/patch-httpdocs_misc_ntopng-add-user.sh net/ntopng/files/patch-httpdocs_misc_ntopng-add-user.sh
new file mode 100644
index 000000000000..2564dd31c714
--- /dev/null
+++ net/ntopng/files/patch-httpdocs_misc_ntopng-add-user.sh
@@ -0,0 +1,17 @@
+--- httpdocs/misc/ntopng-add-user.sh.orig	2020-01-05 10:26:01 UTC
++++ httpdocs/misc/ntopng-add-user.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!%%LOCALBASE%%/bin/bash
+ 
+ ###!/usr/bin/env BASH
+ 
+@@ -111,7 +111,7 @@ function validate_username {
+ 
+ function password_md5 {
+     #make sure the md5 utility works as expected
+-    local admin_md5=`echo -n admin | md5sum | cut -c 1-32`
++    local admin_md5=`echo -n admin | md5 | cut -c 1-32`
+     if [[ $admin_md5 != "21232f297a57a5a743894a0e4a801fc3" ]]
+     then
+ 	echo "md5sum not working as expected"