freedomboneeee/website/deploy.sh

31 lines
540 B
Bash
Raw Permalink Normal View History

2016-01-07 13:14:27 +01:00
#!/bin/bash
lang=$1
dest_dir=$2
if [ ! $lang ]; then
2016-09-11 17:07:18 +02:00
lang='EN'
2016-01-07 13:14:27 +01:00
fi
if [ ! $2 ]; then
2016-09-11 17:07:18 +02:00
echo 'Specify language and destination directory'
exit 1
2016-01-07 13:14:27 +01:00
fi
if [ ! -d $dest_dir ]; then
2016-09-11 17:07:18 +02:00
mkdir -p $dest_dir
2016-01-07 13:14:27 +01:00
fi
if [ ! -d $dest_dir/images ]; then
2016-09-11 17:07:18 +02:00
mkdir $dest_dir/images
2016-01-07 13:14:27 +01:00
fi
2016-01-07 15:27:02 +01:00
cp -r $lang/* $dest_dir
2016-01-07 13:14:27 +01:00
cp *.css $dest_dir
cp -r ../img/* $dest_dir/images
if [ ! -d $dest_dir/downloads ]; then
mkdir $dest_dir/downloads
fi
cp $lang/images.txt $dest_dir/downloads
2016-01-07 13:14:27 +01:00
chown -R www-data:www-data $dest_dir
echo "Website deployed to $dest_dir"