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

lang=$1
dest_dir=$2

Bob Mottram's avatar
Bob Mottram committed
if [ ! "$lang" ]; then
Bob Mottram's avatar
Bob Mottram committed
    lang='EN'
Bob Mottram's avatar
Bob Mottram committed
fi
Bob Mottram's avatar
Bob Mottram committed
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
if [ ! -d "$dest_dir" ]; then
    mkdir -p "$dest_dir"
Bob Mottram's avatar
Bob Mottram committed
fi
Bob Mottram's avatar
Bob Mottram committed
if [ ! -d "$dest_dir/images" ]; then
    mkdir "$dest_dir/images"
Bob Mottram's avatar
Bob Mottram committed
cp -r "$lang"/* "$dest_dir"
cp *.css "$dest_dir"
cp -r ../img/* "$dest_dir/images"
cp -r ../webadmin/EN/help_*.html "$dest_dir"
if [ ! -d "$dest_dir/downloads" ]; then
    mkdir "$dest_dir/downloads"
Bob Mottram's avatar
Bob Mottram committed
cp "$lang/images.txt" "$dest_dir/downloads"
chown -R www-data:www-data "$dest_dir"
Bob Mottram's avatar
Bob Mottram committed

echo "Website deployed to $dest_dir"