diff options
-rwxr-xr-x | neueliste.bash | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/neueliste.bash b/neueliste.bash index b74a606..8299ebc 100755 --- a/neueliste.bash +++ b/neueliste.bash @@ -1,4 +1,10 @@ #!/bin/zsh + +if [ $# -ne 3 ]; then + echo "Interner Fehler: Ungültige Anzahl Parameter" + echo "internal error: invalid number of parameters" +fi + LOCKFILE=/tmp/newlist lockfile-create --retry 1 $LOCKFILE >/dev/null 2>&1 @@ -11,7 +17,7 @@ fi TMPFILE=/tmp/newlistoutput$(date -Is) -if su mailman -c "echo | ~mailman/bin/newlist $1 $2 $3" > $TMPFILE 2>&1 +if echo | ~mailman/bin/newlist -- "$1" "$2" "$3" > $TMPFILE 2>&1 then echo "Erstellung erfolgreich -- creation completed" @@ -25,10 +31,8 @@ else echo "Bitte im Browser auf <a href="/neu/">Zurück</a> klicken und einen anderen Namen für die Mailingliste wählen! Danke.<br>" echo "Please click on <a href="/neu/">back</a> in your browser and enter another name for your mailinglist. Thank you.<br><hr>debug info:" else - echo "Oh, das ist was schief gegangen. Bitte mailman@lists.spline.de kontaktieren!<br>" - echo "Oops, something went wrong here. Please contact the admins at mailman@lists.spline.de !<br><br><pre>" - cat $TMPFILE - echo "</pre>" + echo "Oh, da ist was schief gegangen. Bitte mailman@lists.spline.de kontaktieren!<br>" + echo "Oops, something went wrong here. Please contact the admins at mailman@lists.spline.de !" cat $TMPFILE | mailx -s "$0: Mailinglistenerstellung fehlgeschlagen 1=($1) 2=($2) 3=($3)" mailman@lists.spline.de fi |