Есть вот такой скриптик:
Код: Выделить всё
#!/bin/sh
SRC="/var/spool/altqueue"
DST="$SRC/ready"
cmd="sendmail -OQueueDirectory=$DST -C /etc/mail/sendmail_t.cf -q"
q="q*"
if [ -f "$DST/$q" ]; then
$cmd; exit
elif [ ! -f "$SRC/$q" ]; then
exit
fi
cd $SRC
c=0
for i in $q; do
if [ $c -eq 5 ]; then
break
fi
f=`echo $i | tail -c+2`
mv $i d$f $DST
c=`expr $c + 1`
done
sleep 1
$cmd
Вылечилось убиранием кавычек отсюда:
Код: Выделить всё
if [ -f $DST/$q ]; then
$cmd; exit
elif [ ! -f $SRC/$q ]; then
exit
fi
Код: Выделить всё
uname -a
FreeBSD router.apnet.local 8.3-RELEASE FreeBSD 8.3-RELEASE #0: Fri Jan 4 17:11:04 MSK 2013 root@router.apdom.local:/usr/obj/usr/src/sys/FIREWALL amd64
Код: Выделить всё
ls -l /bin/sh
-r-xr-xr-x 1 root wheel 137504 Apr 10 2012 /bin/sh