#! /bin/bash
#
# Copyright (c) 2016 Jeffrey A. Turkstra <jeff@turkstra.net>
#
# This script deploys the iRODs Project FUSE driver.
#
# IMPORTANT: You must recompile the driver using the notes in DEPLOY before
# running this script!

hosts="mygeohub.org"

for host in ${hosts}; do
  echo "=== ${host} ==="
  ssh root@${host} "umount /sftp/data/projects"
  scp irprojfs-logrotate root@${host}:/etc/logrotate.hubzero.d/irprojfs
  ssh root@${host} "mkdir -p /var/log/irprojfs; chown www-data:root /var/log/irprojfs; chmod 700 /var/log/irprojfs; touch /var/log/irprojfs/irprojfs.log; touch /var/log/irprojfs/irprojfs.git; chmod 600 /var/log/irprojfs/*; chown www-data:www-data /var/log/irprojfs/*"
  scp projfs root@${host}:/sbin/mount.sftpirods
  # scp projfs root@${host}:/sbin/mount.irprojfs
done

