-
Notifications
You must be signed in to change notification settings - Fork 1
/
mirror_quic.sh
executable file
·40 lines (34 loc) · 1.06 KB
/
mirror_quic.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#! /bin/bash
if [ $# -lt 2 ]; then
echo "Usage : Enter site to mirror and mirror destination folder"
exit 5
fi;
PHANTOMJS=/home/skype-alpha/July3rdGoogleMeeting/phantomjs/
site=$1
folder=$2
rm -rf $folder
rm -rf /var/www/$folder
mkdir /var/www/$folder
# Clean up Mininet
sudo ./clean_up_mn.sh
# kill apache
sudo service apache2 stop
sudo killall -s9 apache2
sudo killall -s9 /usr/bin/python
sudo killall -s9 quic_server
# Modify root folder
cd /etc/apache2/sites-available
sed s/"DocumentRoot \/var\/www"/"DocumentRoot \/var\/www\/$folder"/g default.backup > default
cd -
##run phantomjs get_info to create file for website with urls+ips
$PHANTOMJS/bin/phantomjs $PHANTOMJS/examples/get_info.js $site > tempgets.txt
#
##run script to create file to add to /etc/hosts (ips.txt) and create directories according to url paths and fill them with wget objects
python web_mirror_record_quic.py tempgets.txt $folder `pwd`
#sleep 1
#run mininet
python web_mirror_replay_quic.py $folder `pwd` $site $PHANTOMJS
# restore
cd /etc/apache2/sites-available
cp default.backup default
cd -