add wordpress uninstall functionality
This commit is contained in:
33
action.sh
33
action.sh
@@ -38,7 +38,7 @@ PATH=$PATH:$HOME/bin
|
|||||||
|
|
||||||
## FUNCTIONS
|
## FUNCTIONS
|
||||||
function checkaction {
|
function checkaction {
|
||||||
REGEX="^adduser$|^changepw$|^listusers$|^userdetail$|^deluser$|^sizeall$|^sizeuser$|^viewdata$|^addalias$|^quota$|^installwp$"
|
REGEX="^adduser$|^changepw$|^listusers$|^userdetail$|^deluser$|^sizeall$|^sizeuser$|^viewdata$|^addalias$|^quota$|^installwp$|^uninstallwp$"
|
||||||
if [[ $1 =~ $REGEX ]]; then
|
if [[ $1 =~ $REGEX ]]; then
|
||||||
echo "true"
|
echo "true"
|
||||||
else
|
else
|
||||||
@@ -460,3 +460,34 @@ if [ "$ACTION" == "installwp" ]; then
|
|||||||
echo "Please take a look into your data sheet for the login data."
|
echo "Please take a look into your data sheet for the login data."
|
||||||
|
|
||||||
fi # /installwp
|
fi # /installwp
|
||||||
|
|
||||||
|
# # # # #
|
||||||
|
# REMOVE WORDPRESS
|
||||||
|
# # # # #
|
||||||
|
if [ "$ACTION" == "uninstallwp" ]; then
|
||||||
|
echo "Uninstalling WordPress..."
|
||||||
|
echo
|
||||||
|
|
||||||
|
# $USER: Username for Wordpress
|
||||||
|
# $PASS: Email address for Wordpress user
|
||||||
|
|
||||||
|
WEBDIR=$HOME/html
|
||||||
|
|
||||||
|
MYSQLUSER=$SYSUSER
|
||||||
|
MYSQLDB=${MYSQLUSER}_wp
|
||||||
|
|
||||||
|
# Delete database and content of ~/htmp
|
||||||
|
mysql -e "DROP DATABASE ${MYSQLDB};"
|
||||||
|
rm -rf $WEBDIR/*
|
||||||
|
rm -rf $WEBDIR/.*
|
||||||
|
|
||||||
|
# Update datasheet
|
||||||
|
LEAD='## > MYSQL'
|
||||||
|
TAIL='## < MYSQL'
|
||||||
|
|
||||||
|
notesdelete ".*"
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Wordpress successfully uninstalled."
|
||||||
|
|
||||||
|
fi # /uninstallwp
|
||||||
|
|||||||
13
index.php
13
index.php
@@ -190,6 +190,19 @@ This panel will not work without activated JavaScript.</span></noscript>
|
|||||||
<input type="hidden" name="sure" value="yes" />
|
<input type="hidden" name="sure" value="yes" />
|
||||||
</form>
|
</form>
|
||||||
</div> <!-- /hide -->
|
</div> <!-- /hide -->
|
||||||
|
|
||||||
|
<!-- UNINSTALLWP - Uninstall WordPress -->
|
||||||
|
<b class="switch"><span class="turn_on">»</span><span class="turn_off">«</span> Uninstall WordPress</b>
|
||||||
|
<div class="hide">
|
||||||
|
<p>Deletes all files in your webdirectory and the database <YourUsername>_wp.<br />
|
||||||
|
<span class="warn">THIS OPERATION CANNOT BE UNDONE! ALL POST, PAGES AND SETTINGS WILL BE REMOVED!</span></p>
|
||||||
|
<form action="submit.php" method="post">
|
||||||
|
<label for="sure">
|
||||||
|
<input type="checkbox" name="sure" value="yes" id="sure">Yes, I'm really sure that I want to uninstall WordPress completely
|
||||||
|
</label>
|
||||||
|
<button type="submit" name="action" value="deluser">Uninstall WordPress</button>
|
||||||
|
</form>
|
||||||
|
</div> <!-- /hide -->
|
||||||
|
|
||||||
</div> <!-- /gallery -->
|
</div> <!-- /gallery -->
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user