clean.sh 474 Bytes
Newer Older
Őry Máté committed
1 2 3 4 5 6 7 8 9 10
#!/bin/bash


if [ "$1" != -f ]
then
    echo 'Clear ALL PRIVATE DATA ON THE VM. This is used for praparing VM template.'
    echo -- '-f switch is required.'
    exit 1
fi

Őry Máté committed
11
cp /opt/webadmin/cloud/miscellaneous/devenv/{.bash_login,init.sh,clean.sh} ~/
Őry Máté committed
12 13 14 15 16 17 18 19 20 21 22
rm -rf /opt/webadmin/cloud*
rm .bash_history
rm -f ~/.gitconfig
mysql <<A
DROP USER webadmin@localhost;
A
mysql <<A
DROP DATABASE webadmin;
A

sudo chpasswd <<<'cloud:ezmiez'
Őry Máté committed
23
sudo passwd -e cloud
24
rm ~/.ssh/authorized_keys