Skip to content

Instantly share code, notes, and snippets.

@magnolia-k
Last active December 28, 2015 23:58
Show Gist options
  • Save magnolia-k/7582329 to your computer and use it in GitHub Desktop.
Save magnolia-k/7582329 to your computer and use it in GitHub Desktop.
#!/bin/sh
# setup shellscript for Stylistics
STYLISTICS_URL=https://github.com/magnolia-k/Stylistics/archive/master.zip
STYLISTICS_DIR=/opt/Stylistics/
# check env
if [ ! `which git` ]; then
echo "git isn't installed"
exit 1
fi
if [ ! `which curl` ]; then
echo "curl isn't installed"
fi
# download archive file
WORKDIR=`mktemp -d --tmpdir stylistics.XXXXXX` || exit 1
cd $WORKDIR || exit 1
echo 'Download archive file for Stylistics'
curl -s -Lo master.zip $STYLISTICS_URL || exit 1
unzip master.zip || exit 1
cd Stylistics-master || exit 1
# restart stylistics
echo 'Copy files'
initctl stop stylistics
cp -p -r -u * $STYLISTICS_DIR || exit 1
cd $STYLISTICS_DIR
/opt/perl-5.18/bin/carton install
chown -R www-data:www-data * || exit 1
initctl start stylistics
cd $HOME
rm -rf $WORKDIR || exit 1
echo 'Finish copy'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment