Izmjene za Lintian:
[postfix-cn.git] / newaliases-gecos
deleted file mode 120000 (symlink)
index 05fbd6f80ddf864269cd498ff156100a7065fa37..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1 +0,0 @@
-../share/postfix-cn/make-aliases-gecos.sh
\ No newline at end of file
new file mode 100755 (executable)
index 0000000000000000000000000000000000000000..f831cf4c9e740347346279f8a511a0fe40241fa5
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+set -e
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH
+
+[ -x /usr/sbin/postalias ] || exit 0
+[ -f /etc/postfix/main.cf ] || exit 0
+gecos="/var/lib/postfix-cn/aliases_gecos"
+grep -q "hash:$gecos" /etc/postfix/main.cf || exit 0
+
+[ -d /var/lib/postfix-cn/ ] || exit 0
+
+# Load CARNet Tools
+. /usr/share/carnet-tools/functions.sh
+
+getent passwd | awk -F: '
+        $3 >= 100 && $1 != "nobody" && $5 \
+        {
+                split($5, g, ",");
+               if (g[1]=="") {next};
+                gsub(/ /, ".", g[1]);
+                print tolower(g[1]) ": " $1;
+        }' > $gecos.dpkg-tmp.$$
+
+
+if ! cmp -s $gecos.dpkg-tmp.$$ $gecos > /dev/null; then
+  cp_mv $gecos.dpkg-tmp.$$ $gecos
+  postalias hash:$gecos
+else
+  rm -f $gecos.dpkg-tmp.$$
+fi