Merge branch 'new_year'

Conflicts:
	src/pizza
This commit is contained in:
Oliver Rümpelein 2015-01-02 21:45:00 +01:00
commit 55c32ccb80
2 changed files with 73 additions and 44 deletions

25
assets/new_year Normal file
View file

@ -0,0 +1,25 @@
.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:.
* ) *
) * (
) ( (
( ) ( )
) * ) ) (
( ( ( *
) H ) )
[ ] (
( * |-| * ) (
* ) |_| . )
( | | .
) / \ . ' . *
( |_____| ' . .
) | ___ | \~~~/ ' . (
* | \ / | \_/ \~~~/ )
| _Y_ | | \_/ (
* |-----| __|__ | *
`-----` __|__
__, ,__) __, ,__) __, ,__)
(--|__| _ ,_ ,_ (--|\ | _ (--\ | _ _ ,_
_| |(_||_)|_)(_| _| \|(/_(_|_) \|(/_(_||
( | | ,_| ( (__|
.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:.

View file

@ -8,61 +8,65 @@ PIZZARCV=
PIZZASEND= PIZZASEND=
help() { help() {
echo "pizza - sent small ASCII-Icons by Mail" echo "pizza - sent small ASCII-Icons by Mail"
echo "--------------------------------------" echo "--------------------------------------"
echo "Usage: -p Send a pizza (default)" echo "Usage: -p Send a pizza (default)"
echo " -l Send a heart" echo " -l Send a heart"
echo " -b Send happy birthday" echo " -b Send happy birthday"
echo " -c Send merry christmas" echo " -c Send merry christmas"
echo " -m <addr> Receivers address (non-optional)" echo " -n Send a happy new year"
echo " -s <addr> Senders address, defaults to user@host" echo " -m <addr> Receivers address (non-optional)"
echo " -h Print this help-message" echo " -s <addr> Senders address, defaults to user@host"
echo " -h Print this help-message"
} }
if [ ! $1 ]; then if [ ! $1 ]; then
echo "Argument needed!" echo "Argument needed!"
help help
exit 1 exit 1
fi fi
while getopts "plbchm:s:" opt; do while getopts "plbcnhm:s:" opt; do
case ${opt} in case ${opt} in
p ) p )
: ${PIZZAART:="pizza"} : ${PIZZAART:="pizza"}
;; ;;
l ) l )
: ${PIZZAART:="heart"} : ${PIZZAART:="heart"}
;; ;;
b ) b )
: ${PIZZAART:="birthdaycake"} : ${PIZZAART:="birthdaycake"}
;; ;;
c ) c )
: ${PIZZAART:="christmastree"} : ${PIZZAART:="christmastree"}
;; ;;
m ) n )
PIZZARCV="${OPTARG}" : ${PIZZAART:="new_year"}
;; ;;
s ) m )
PIZZASEND="${OPTARG}" PIZZARCV="${OPTARG}"
;; ;;
h ) s )
help PIZZASEND="${OPTARG}"
exit 0 ;;
;; h )
\?) help
help exit 0
exit 1 ;;
;; \?)
esac help
exit 1
;;
esac
done done
: ${PIZZAART:="pizza"} : ${PIZZAART:="pizza"}
: ${PIZZASEND:="${PIZZAUSER}@${PIZZAHOST}"} : ${PIZZASEND:="${PIZZAUSER}@${PIZZAHOST}"}
if [ ! $PIZZARCV ]; then if [ ! $PIZZARCV ]; then
echo "Argument '-m' and mailaddress needed!" echo "Argument '-m' and mailaddress needed!"
help help
exit 1 exit 1
fi fi
mail -s "${PIZZAUSER} sent you a ${PIZZAART} on ${PIZZAHOST}!" -S from=${PIZZASEND} ${PIZZARCV} < "${PIZZAINC}/${PIZZAART}" mail -s "${PIZZAUSER} sent you a ${PIZZAART} on ${PIZZAHOST}!" -S from=${PIZZASEND} ${PIZZARCV} < "${PIZZAINC}/${PIZZAART}"