diff --git a/src/pizza b/src/pizza old mode 100644 new mode 100755 index 3bca4d4..868b196 --- a/src/pizza +++ b/src/pizza @@ -1,5 +1,9 @@ #!/bin/bash +: ${PIZZAINC:="/usr/local/share/pizza"} +PIZZAHOST=$(hostname -f) +PIZZAUSER=$(whoami) + help() { echo "pizza - sent small ASCII-Icons by Mail" echo "--------------------------------------" @@ -9,15 +13,15 @@ help() { } if [ ! "$2" ]; then - mail -s "$(whoami) sent you a Pizza on srv.r.f3l.de!" $1 < /usr/local/share/pizza/pizza.txt + mail -s "${PIZZAUSER} sent you a Pizza on ${PIZZAHOST}!" $1 < "${PIZZAINC}/pizza" exit 0 else case "$1" in "-p" | "--pizza") - mail -s "$(whoami) sent you a Pizza on srv.r.f3l.de" $2 < /usr/local/share/pizza/pizza.txt + mail -s "${PIZZAUSER} sent you a Pizza on ${PIZZAHOST}" $2 < "${PIZZAINC}/pizza" ;; "-l" | "--heart") - mail -s "$(whoami) sent you a Heart on srv.r.f3l.de" $2 < /usr/local/share/pizza/heart.txt + mail -s "${PIZZAUSER} sent you a Heart on ${PIZZAHOST}" $2 < "${PIZZAINC}/heart.txt" ;; "-h" | "--help") help