#!/bin/bash
/p4/1/bin/p4d_1_init stop
rm -rf /mnt/p4meta/p4
rm -rf /mnt/p4data/p4
rm -rf /mnt/p4data/sdp*
rm -rf /p4/ssl
rm -f /p4/p4.crontab*
rm -rf /p4/1

unlink /p4/common
unlink /p4/sdp

cd /mnt/p4data
wget https://swarm.workshop.perforce.com/downloads/guest/russell_jackson/sdp.tgz
tar xvzf sdp.tgz
cd sdp/Server/Unix/p4/common/bin
wget ftp://ftp.perforce.com/perforce/r18.2/bin.linux26x86_64/p4
wget ftp://ftp.perforce.com/perforce/r18.2/bin.linux26x86_64/p4d
cd /mnt/p4data
chown -R perforce:perforce sdp
cd /mnt/p4data/sdp/Server/Unix/setup
./mkdirs.sh 1
/p4/1/bin/p4d_1_init start
su - perforce
/p4/sdp/Server/Unix/configure_new_server.sh 1
