#! /bin/bash

currentdate=`date +%s`

VIRTUALFST='/home/virtual/FILESYSTEMTEMPLATE/siteinfo'

if [ -e $VIRTUALFST/etc/.wpkey ]; then
  cp -f $VIRTUALFST/etc/.wpkey /var/log/wpkey.$currentdate
fi

touch $VIRTUALFST/etc/.wpkey
chmod 0400 $VIRTUALFST/etc/.wpkey
head -c 256 /dev/urandom > $VIRTUALFST/etc/.wpkey

exit 0
