Skip to content

Instantly share code, notes, and snippets.

@IljaN
Last active August 31, 2017 20:32
Show Gist options
  • Save IljaN/c5ebca778bdb227d637480065eb7c9d8 to your computer and use it in GitHub Desktop.
Save IljaN/c5ebca778bdb227d637480065eb7c9d8 to your computer and use it in GitHub Desktop.
Bisect-Automation: Install owncloud, Sync files with desktop client, check if miral client has a token
#!/bin/bash
# Assumes that owncloud runs on localhost:8000 and desktop-client is installed
# Kill running sync client to suppress deletion warning
pkill owncloud
# Kill current config, inject autoconfig
rm -rf /home/ilja/ownCloud/*
rm ./config/config.php
rm -rf ./data
cp autoconfig.php ./config/
# Install
echo "Running make..."
make
# Trigger setup
curl -L http://localhost:8000
sleep 5s
# Restart client and create a few files to sync them to the new instance
/usr/bin/owncloud &
sleep 3s
touch "/home/ilja/ownCloud/$(date +%s)"
touch "/home/ilja/ownCloud/$(date +%s).2"
touch "/home/ilja/ownCloud/$(date +%s).3"
sleep 3s
git checkout ./.htaccess
# Check if sync client is in oc_authtoken
exit $(sqlite3 data/owncloud.db "SELECT CASE WHEN COUNT(*) > 0 THEN 0 ELSE 1 END AS code FROM oc_authtoken WHERE name LIKE '%mirall%';")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment