Skip to content

Instantly share code, notes, and snippets.

@IljaN
Created December 15, 2017 12:05
Show Gist options
  • Save IljaN/ecbd1934f52b336b5cbf621ce28d13e7 to your computer and use it in GitHub Desktop.
Save IljaN/ecbd1934f52b336b5cbf621ce28d13e7 to your computer and use it in GitHub Desktop.
Owncloud dev reset script
#!/bin/bash
# A script to quickly reset your local owncloud.
# WARNING: Your Database and data directory will be deleted!!!
# A user admin with password admin is created.
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DATA_DIR=$CURRENT_DIR/data
OWNCLOUD_URL=http://localhost:8000
# Kill current config and data
rm ./config/config.php
rm -rf ./data
cat << EOF > ./config/autoconfig.php
<?php
\$AUTOCONFIG = array(
"dbtype" => "sqlite",
"dbname" => "owncloud",
"dbtableprefix" => "",
"adminlogin" => "admin",
"adminpass" => "admin",
"directory" => "$DATA_DIR",
);
EOF
# Install
make
# Trigger setup
curl -L ${OWNCLOUD_URL}
sleep 2s
git checkout ./.htaccess
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment