base-files: fix group/user settings after sysupgrade
authorJohn Crispin <blogic@openwrt.org>
Fri, 29 Apr 2016 01:30:52 +0000 (03:30 +0200)
committerJohn Crispin <blogic@openwrt.org>
Fri, 29 Apr 2016 02:15:34 +0000 (04:15 +0200)
Signed-off-by: John Crispin <john@phrozen.org>
package/base-files/files/etc/uci-defaults/13_fix_group_user [new file with mode: 0644]

diff --git a/package/base-files/files/etc/uci-defaults/13_fix_group_user b/package/base-files/files/etc/uci-defaults/13_fix_group_user
new file mode 100644 (file)
index 0000000..deade5b
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+. /lib/functions.sh
+
+for file in `grep Require-User /usr/lib/opkg/info/*.control | cut -d: -f1`; do
+       file="${file##*/}"
+       file="${file%.control}"
+       add_group_and_user "${file}"
+done
+
+exit 0