#!/bin/bash # this is where Cypht will be installed DESTINATION="/usr/share/cypht" # validate the destination directory sudo test -r $DESTINATION -a -x $DESTINATION if [ $? -ne 0 ]; then sudo mkdir $DESTINATION fi # create working directory mkdir cypht-temp cd cypht-temp # grab latest code wget https://github.com/jasonmunro/cypht/archive/master.zip # unpack the archive unzip -q master.zip # create a vanilla ini file cp cypht-master/hm3.sample.ini cypht-master/hm3.ini # fix permissions and ownership find cypht-master -type d -print | xargs chmod 755 find cypht-master -type f -print | xargs chmod 644 sudo chown -R www-data:www-data cypht-master # copy to destination folder sudo cp -rf cypht-master/* $DESTINATION # remove working directory cd .. sudo rm -rf cypht-temp sudo pico $DESTINATION/hm3.ini