From 68291754d40f311426df1fc8aa4400b0517a4392 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Wed, 2 Aug 2006 16:01:40 +0000 Subject: Drop superfluous keyword 'function' and the script should work with plais sh. --- localmkpostfixvirtual | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'localmkpostfixvirtual') diff --git a/localmkpostfixvirtual b/localmkpostfixvirtual index f093d00..40bcc17 100755 --- a/localmkpostfixvirtual +++ b/localmkpostfixvirtual @@ -1,9 +1,9 @@ -#!/bin/bash +#!/bin/sh # # /usr/local/sbin/localmkpostfixvirtual # Copyright 2001-2002 Jonas Smedegaard # -# $Id: localmkpostfixvirtual,v 1.19 2006-08-02 16:00:12 jonas Exp $ +# $Id: localmkpostfixvirtual,v 1.20 2006-08-02 16:01:40 jonas Exp $ # # Generate virtual file for postfix # @@ -38,15 +38,15 @@ # TODO: Write command "members" as internal code # -function get_fullname_field() { getent passwd $1 | awk -F: '{print $5}' | awk -F, '{print $1}'; } -function get_roomnumber_field() { getent passwd $1 | awk -F: '{print $5}' | awk -F, '{print $2}'; } -function get_other_field() { getent passwd $1 | awk -F: '{print $5}' | awk -F, '{print $5}'; } -function get_groups() { groups $1 | sed -e 's/^.*: //' -e "s/\( \+\|^\)$1\( \+\|$\)/\1/"; } -function get_domain() { echo $1 | egrep "^@[\.[:alnum:]-]+$" | sed -e 's/@//'; } -function get_account() { echo $1 | egrep "^([\.[:alnum:]_-]+|\+)@($gid|$maildomain)?$" | sed -e 's/@.*//'; } -function sort_u() { for x in $@; do echo $x; done | sort -u; } +get_fullname_field() { getent passwd $1 | awk -F: '{print $5}' | awk -F, '{print $1}'; } +get_roomnumber_field() { getent passwd $1 | awk -F: '{print $5}' | awk -F, '{print $2}'; } +get_other_field() { getent passwd $1 | awk -F: '{print $5}' | awk -F, '{print $5}'; } +get_groups() { groups $1 | sed -e 's/^.*: //' -e "s/\( \+\|^\)$1\( \+\|$\)/\1/"; } +get_domain() { echo $1 | egrep "^@[\.[:alnum:]-]+$" | sed -e 's/@//'; } +get_account() { echo $1 | egrep "^([\.[:alnum:]_-]+|\+)@($gid|$maildomain)?$" | sed -e 's/@.*//'; } +sort_u() { for x in $@; do echo $x; done | sort -u; } -function print_accounts() { +print_accounts() { uid=$1 maildomain=$2 pre_text=$3 -- cgit v1.2.3