#!/bin/sh case $# in 1) ;; *) echo 'usage: dm_add_ml ' exit 1 ;; esac source /etc/decimail.conf eval $DECIMAIL_DB_CONNECTION opts="" if [ $port ] then opts="$opts -p $port" fi if [ $dbname ] then opts="$opts -d $dbname" fi if [ $user ] then opts="$opts -U $user" fi list_name=$1; username=`whoami` cmd="delete from mailing_lists where username='$username' and list_name='$list_name';" echo $cmd psql $opts -c "$cmd"