!/bin/bash
export depots=/mnt/p4data
export dbs=/mnt/p4meta
export logs=/mnt/p4logs
apt-get --assume-yes install mailutils
apt-get --assume-yes install python
apt-get --assume-yes install screen
apt-get --assume-yes install iputils-ping
groupadd perforce
useradd -m -d /p4 -g perforce -G sudo -p 3cr0Fr@P -s /bin/bash perforce
chown perforce:perforce $depots
chown perforce:perforce $dbs
chown perforce:perforce $logs
echo never | tee /sys/kernel/mm/transparent_hugepage/enabled
cd $logs
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/r22.1/bin.linux26x86_64/p4
wget ftp://ftp.perforce.com/perforce/r22.1/bin.linux26x86_64/p4d
cd $logs
chown -R perforce:perforce sdp
cd sdp/Server/Unix/setup
cp template.mkdirs.cfg mkdirs.cfg
vi mkdirs.cfg