1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/shaarli_ynh.git synced 2024-09-03 20:26:10 +02:00

Update install script for 0.8.3

This commit is contained in:
lapineige 2017-02-19 23:17:19 +01:00
parent 2ece80f9af
commit 8e6cea0f87

View file

@ -8,6 +8,9 @@ title=$4
privatelinkbydefault=$5 privatelinkbydefault=$5
admin=$6 admin=$6
# Load common variables and helpers
source ./_common.sh
# Check that admin user is an existing account # Check that admin user is an existing account
sudo yunohost user list --json | grep -q "\"username\": \"$admin\"" sudo yunohost user list --json | grep -q "\"username\": \"$admin\""
if [[ ! $? -eq 0 ]]; then if [[ ! $? -eq 0 ]]; then
@ -28,14 +31,17 @@ sudo apt-get install php5-cli -y -qq
# Copy files to the right place # Copy files to the right place
app_home_path=/home/yunohost.app/shaarli app_home_path=/home/yunohost.app/shaarli
final_path=/var/www/shaarli final_path=/var/www/shaarli
sudo mkdir -p $final_path
sudo cp -r ../sources/* $final_path
for subdir in data cache pagecache tmp sudo mkdir -p $final_path
do # Download and extract in /var/www
sudo mkdir -p $app_home_path/$subdir extract_shaarli
sudo chown -R www-data: $app_home_path/$subdir
done sudo mkdir -p $app_home_path/data
sudo mkdir -p $app_home_path/cache
sudo mkdir -p $app_home_path/pagecache
sudo mkdir -p $app_home_path/tmp
sudo mkdir -p $app_home_path/conf
sudo chown -R www-data: $app_home_path
salt=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za-z0-9' | sed -n 's/\(.\{24\}\).*/\1/p') salt=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za-z0-9' | sed -n 's/\(.\{24\}\).*/\1/p')
if [ $privatelinkbydefault = "No" ]; then if [ $privatelinkbydefault = "No" ]; then
@ -56,7 +62,7 @@ sudo php ../conf/init_config_user.php $(sudo yunohost user list --json | python
sudo find $final_path -type f | xargs sudo chmod 644 sudo find $final_path -type f | xargs sudo chmod 644
sudo find $final_path -type d | xargs sudo chmod 755 sudo find $final_path -type d | xargs sudo chmod 755
sudo chown -R root: $final_path #sudo chown -R root: $final_path
sudo find $app_home_path -type f | xargs sudo chmod 600 sudo find $app_home_path -type f | xargs sudo chmod 600
sudo find $app_home_path -type d | xargs sudo chmod 700 sudo find $app_home_path -type d | xargs sudo chmod 700