# Prepare docker
# docker pull docker.futuredial.com/isd_server:1.8.1

# Install settings
rm -r /var/www/isd/installer/1.8.1/
wget http://cmc-dl.futuredial.com/tools/isd/isd_installer_1.8.1.tar.gz
mkdir -p /var/www/isd/installer/1.8.1/
mkdir -p /var/www/isd/log/
tar zxvf isd_installer_1.8.1.tar.gz -C /var/www/isd/installer/1.8.1/
cd /var/www/isd/installer/1.8.1/
docker load < isd_server_1.8.1.tar
cp start_server.sh /var/www/isd/start_server.sh
systemctl enable docker
supervisorctl restart isd_server

# apply patch
mkdir patch-20180221
cd patch-20180221
wget http://cmc-dl.futuredial.com/tools/isd/patch-20180221-v1.8.0.tar.gz
tar zxvf patch-20180221-v1.8.0.tar.gz
docker cp fix.py isd:/var/www/fd_ipsw/web/fix.py
docker cp patch.sh isd:/var/www/fd_ipsw/web/patch.sh
docker exec -i isd /bin/bash /var/www/fd_ipsw/web/patch.sh
cd ..
rm -r patch-20180221