Resize /system in boot

Is it really safe?
Tested on Allview V3 Viper and Huawei Mate 9
diff --git a/resize-system.sh b/resize-system.sh
new file mode 100644
index 0000000..cc90237
--- /dev/null
+++ b/resize-system.sh
@@ -0,0 +1,11 @@
+#!/system/bin/sh
+
+set -e
+
+if [ "grep ' /system ' /proc/mounts  |cut -d ' ' -f 1 |wc -l" -ne 1 ];then
+	exit 0
+fi
+
+mount -o remount,rw /system
+resize2fs $(grep ' /system ' /proc/mounts |cut -d ' ' -f 1)
+mount -o remount,ro /system