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
|
||||
|
||||
if [ $# -lt 2 ]; then
|
||||
echo $0 ordernum num-cables [otherinfo]
|
||||
if [ $# -lt 1 ]; then
|
||||
echo $0 ordernum [num-cables] [otherinfo]
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ordernum=$1; shift
|
||||
numcables=$1; shift
|
||||
|
||||
if [ $# -ge 1 ]; then
|
||||
numcables=$1; shift
|
||||
else
|
||||
numcables=1
|
||||
fi
|
||||
|
||||
other="$@"
|
||||
date=$(date -R)
|
||||
|
||||
|
||||
f=nico.schottelius
|
||||
f2=ungleich.ch
|
||||
fall=${f}@${f2}
|
||||
|
||||
cat <<EOF |
|
||||
To: d2b@digitec.ch
|
||||
From: Nico Schottelius <${f}@$f2}>
|
||||
Subject: Falsches Stromkabel Bestellung
|
||||
Hello World
|
||||
cat <<EOF | /usr/sbin/sendmail ${fall}
|
||||
From: Nico Schottelius <${fall}>
|
||||
To: digitec <d2b@digitec.ch>
|
||||
Subject: Falsches Stromkabel Bestellung ${ordernum}
|
||||
Date: ${date}
|
||||
|
||||
Hallo Digitec,
|
||||
|
||||
die Bestellung ${ordernum} kam mit einem Schuko-Anschlusskabel anstatt
|
||||
Schweizer Stecker. Bitte ${numcables} Adapter nachliefern.
|
||||
|
||||
Gruss,
|
||||
|
||||
Nico Schottelius
|
||||
|
||||
EOF
|
||||
|
|
Loading…
Reference in a new issue