#!/bin/bash

## to upload oporp

set -e

if [ ! -f /etc/wpa_supplicant.conf ]; then
    echo "do not use on production machine"
    exit
fi

pwd=`pwd`
cd ~/ernad/style/bims
xsltproc oporp.xslt.xml ~/root.xml > ~/bims/public_html/oporp.html
rsync -qa ~/bims/public_html/oporp.html ernad@bims:~/bims/public_html/oporp.html  &
rsync -qa ~/ernad/js/oporp.js ernad@bims:~/ernad/js/oporp.js  &
ssh bims '/usr/bin/sudo systemctl restart oporp_bims' &
cd $pwd
