digitec: improve script
This commit is contained in:
parent
35aa56cfdb
commit
f07681b0f7
1 changed files with 25 additions and 8 deletions
33
digitec-cable.sh
Normal file → Executable file
33
digitec-cable.sh
Normal file → Executable file
|
@ -1,22 +1,39 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
if [ $# -lt 2 ]; then
|
if [ $# -lt 1 ]; then
|
||||||
echo $0 ordernum num-cables [otherinfo]
|
echo $0 ordernum [num-cables] [otherinfo]
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ordernum=$1; shift
|
ordernum=$1; shift
|
||||||
numcables=$1; shift
|
|
||||||
|
if [ $# -ge 1 ]; then
|
||||||
|
numcables=$1; shift
|
||||||
|
else
|
||||||
|
numcables=1
|
||||||
|
fi
|
||||||
|
|
||||||
other="$@"
|
other="$@"
|
||||||
|
date=$(date -R)
|
||||||
|
|
||||||
|
|
||||||
f=nico.schottelius
|
f=nico.schottelius
|
||||||
f2=ungleich.ch
|
f2=ungleich.ch
|
||||||
|
fall=${f}@${f2}
|
||||||
|
|
||||||
cat <<EOF |
|
cat <<EOF | /usr/sbin/sendmail ${fall}
|
||||||
To: d2b@digitec.ch
|
From: Nico Schottelius <${fall}>
|
||||||
From: Nico Schottelius <${f}@$f2}>
|
To: digitec <d2b@digitec.ch>
|
||||||
Subject: Falsches Stromkabel Bestellung
|
Subject: Falsches Stromkabel Bestellung ${ordernum}
|
||||||
Hello World
|
Date: ${date}
|
||||||
|
|
||||||
|
Hallo Digitec,
|
||||||
|
|
||||||
|
die Bestellung ${ordernum} kam mit einem Schuko-Anschlusskabel anstatt
|
||||||
|
Schweizer Stecker. Bitte ${numcables} Adapter nachliefern.
|
||||||
|
|
||||||
|
Gruss,
|
||||||
|
|
||||||
|
Nico Schottelius
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
Loading…
Add table
Reference in a new issue