echo" This will run RealtimeStandaloneMain service in background"
PF=./twitter4j.properties
# check twitter_realtime.spec exists
[ ! -e twitter_realtime.spec ]&&echo"expecting file twitter_realtime.spec (as specified by property druid.realtime.specFile) to be in current directory"&&exit3
# if twitter4j.properties already exists, then user is okay with having twitter pw in file.
# Otherwise a twitter4j.properties file in curr. dir. is made temporarily for twitter login.
if[ -e "$PF"];then
PF_CLEANUP="date"
trap"exit 1"12315
else
PF_CLEANUP="/bin/rm $PF"
trap"${PF_CLEANUP} ; exit 1"12315
touch $PF
chmod 700$PF
echo" Your twitter user login name and pw is needed "
read -p 'twitter username? ' TWIT_USER
read -s -p 'twitter password? ' TWIT_PW
echo"user=${TWIT_USER}" >> $PF
echo"password=${TWIT_PW}" >> $PF
TWIT_PW=""
fi
trap"${PF_CLEANUP} ; exit 1"12315
# props are set in src/main/resources/runtime.properties
[ -d /tmp/twitter_realtime ]&&echo"cleaning up from previous run.."&& /bin/rm -fr /tmp/twitter_realtime
echo"Log output of service can be found in ./RealtimeNode.out"