opensim-tools – Rev 38
?pathlinks?
#!/bin/bash
###########################################################################
## Copyright (C) Wizardry and Steamworks 2013 - License: GNU GPLv3 ##
## Please see: http://www.gnu.org/licenses/gpl.html for legal details, ##
## rights of fair usage, the disclaimer and warranty conditions. ##
###########################################################################
# clear log files
find /var/log/ -type f -exec truncate --size 0 '{}' \;
# clear backup files
find / -name *~ -exec rm -rf '{}' \;
# clear svn
su root -c "rm -rf ~/.subversion"
# clear iar/oar
if [ -d /var/lib/iar/ ]; then
rm -rf /var/lib/iar/*
fi
# dump database
mysql -u debian-sys-maint -pvu9VYfFIcb0qcRVC -e 'drop database opensim';
mysql -u debian-sys-maint -pvu9VYfFIcb0qcRVC -e 'create database opensim';
dialog --msgbox "Please type in a new root password at the next prompt." 10 70
passwd root
dialog --msgbox "Please type in a new opensim user password at the next prompt." 10 70
passwd opensim
# clear history
su root -c "history -c && rm -rf /root/.bash_history"
su opensim -c "history -c && rm -rf /home/opensim/.bash_history"
halt -p