-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrestartServer.sh
More file actions
22 lines (19 loc) · 942 Bytes
/
restartServer.sh
File metadata and controls
22 lines (19 loc) · 942 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
previousProcessId=`echo $(cat /home/ec2-user/Disaster-Analysis/.processID) `
echo $previousProcessId
if [[ $previousProcessId == "" ]]; then
source /home/ec2-user/Disaster-Analysis/venv/bin/activate
python /home/ec2-user/Disaster-Analysis/storeTweetsInMongoDBUsingTweepy.py &
echo "$!" > /home/ec2-user/Disaster-Analysis/.processID
elif [[ $previousProcessId != "" ]]; then
checkProcessID=`echo $(ps -ef | egrep -iw $previousProcessId | grep -iv "grep" | wc -l )`
if [[ $checkProcessID == 0 ]]; then
source /home/ec2-user/Disaster-Analysis/venv/bin/activate
python /home/ec2-user/Disaster-Analysis/storeTweetsInMongoDBUsingTweepy.py &
echo "$!" > /home/ec2-user/Disaster-Analysis/.processID
fi
#echo $checkProcessID
fi
#source /home/ec2-user/Disaster-Analysis/venv/bin/activate
#python /home/ec2-user/Disaster-Analysis/storeTweetsInMongoDBUsingTweepy.py &
#echo "$!" > /home/ec2-user/Disaster-Analysis/.processID