Skip to content
Snippets Groups Projects
deploy.sh 459 B
Newer Older
Bob Mottram's avatar
Bob Mottram committed
#!/bin/bash

lang=$1
dest_dir=$2

if [ ! $lang ]; then
Bob Mottram's avatar
Bob Mottram committed
    lang='EN'
Bob Mottram's avatar
Bob Mottram committed
fi
if [ ! $2 ]; then
Bob Mottram's avatar
Bob Mottram committed
    echo 'Specify language and destination directory'
    exit 1
Bob Mottram's avatar
Bob Mottram committed
fi

if [ ! -d $dest_dir ]; then
Bob Mottram's avatar
Bob Mottram committed
    mkdir -p $dest_dir
Bob Mottram's avatar
Bob Mottram committed
fi
if [ ! -d $dest_dir/images ]; then
Bob Mottram's avatar
Bob Mottram committed
    mkdir $dest_dir/images
Bob Mottram's avatar
Bob Mottram committed
cp -r $lang/* $dest_dir
Bob Mottram's avatar
Bob Mottram committed
cp *.css $dest_dir
cp -r ../img/* $dest_dir/images
cp $lang/images.txt $dest_dir
Bob Mottram's avatar
Bob Mottram committed
chown -R www-data:www-data $dest_dir

echo "Website deployed to $dest_dir"