#!/bin/bash # or /bin/ksh or any POSIX compliant shell # mmf.sh -- a shell script to MAKE MONEY FAST # Copyright (C) 1999 Sven Türpe # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Credits: # Based on a program written in C by Monika Wolff . # # TODO: # * i18n (mmf.sh currently talks to the user in german) # configuration section MIN_AMOUNT=256 MAX_AMOUNT=65536 ACCOUNT_NUMBER=0815 ROUTING_CODE=0816 BANK="Spaßkasse" # shorten the sleep intervals to make money even faster SHORTSLEEP=3 SLEEP=6 LONGSLEEP=12 # end of configuration section # ^D or SIGKILL terminate the mmf.sh process trap "" TERM trap "" INT while : do clear echo -n "Bitte geben Sie eine Zahl zwischen ${MIN_AMOUNT} und " echo -n "${MAX_AMOUNT} ein: " read if [ $? -ne 0 ] then # EOF echo "Schüss." exit 0 fi echo # Anzahl der Parameter pruefen # $REPLY enthaelt Ergebnis von read set -- $REPLY if [ $# -ne 1 ] then echo "EINE Zahl, Du Huhn!" sleep $SLEEP continue fi # Fein, nur ein Parameter. Das ist eine Zahl, wenn jedes einzelne # Zeichen eine Zahl ist. REPLYCPY=$REPLY while [ ${#REPLYCPY} -gt 0 ] do REPLYLEN=${#REPLYCPY} REPLYCPY=${REPLYCPY#[0123456789]} if [ $REPLYLEN -eq ${#REPLYCPY} ] then echo "Eine ZAHL, Du Huhn!" sleep $SLEEP continue 2 fi done # weiter im Text if [ $REPLY -lt $MIN_AMOUNT ] then echo "Sie haben nur ${REPLY} eingegeben." echo "Schade. Diese Zahl ist zu klein." sleep $SLEEP continue fi echo "Sie haben ${REPLY} eingegeben." if [ $REPLY -gt $MAX_AMOUNT ] then echo "Das kann ich doch nicht annehmen!" sleep $SHORTSLEEP echo "Aber wenn Sie darauf bestehen ... " echo "... na schön, überredet. Her damit!" fi echo "Bitte überweisen Sie den entsprechenden Betrag auf mein Konto " echo "Nr. ${ACCOUNT_NUMBER} bei der ${BANK}, BLZ ${ROUTING_CODE}." echo "Dankeschön. Bitte besuchen Sie uns bald wieder!" sleep $LONGSLEEP done