1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/spip_ynh.git synced 2024-09-03 20:25:59 +02:00
spip_ynh/scripts/install

55 lines
1.2 KiB
Text
Raw Normal View History

2015-04-28 17:54:25 +02:00
#!/bin/bash
2016-09-20 01:51:28 +02:00
source .fonctions
CLEAN_SETUP () {
echo ""
}
TRAP_ON
2016-08-30 00:22:47 +02:00
domain=$YNH_APP_ARG_DOMAIN
path=$YNH_APP_ARG_PATH
admin=$YNH_APP_ARG_ADMIN
language=$YNH_APP_ARG_LANGUAGE
2016-09-20 01:51:28 +02:00
is_public=$YNH_APP_ARG_IS_PUBLIC
app=$YNH_APP_INSTANCE_NAME
# Source app helpers
source /usr/share/yunohost/helpers
CHECK_VAR "$app" "app name not set"
CHECK_USER "$admin"
2015-04-28 17:54:25 +02:00
2016-09-20 01:51:28 +02:00
CHECK_PATH
2015-04-28 17:05:35 +02:00
2016-09-20 01:51:28 +02:00
CHECK_DOMAINPATH
2015-04-28 17:05:35 +02:00
2016-09-20 01:51:28 +02:00
CHECK_FINALPATH
2015-04-28 17:05:35 +02:00
2016-09-20 01:51:28 +02:00
sudo yunohost app setting $app domain -v $domain
sudo yunohost app setting $app path -v $path
sudo yunohost app setting $app admin -v $admin
sudo yunohost app setting $app is_public -v $is_public
sudo yunohost app setting $app language -v $language
2015-04-28 17:05:35 +02:00
2016-09-20 01:51:28 +02:00
GENERATE_DB $app # Créer une base de données et un utilisateur dédié au nom de l'app.
2015-04-28 17:05:35 +02:00
2016-09-20 01:51:28 +02:00
SETUP_SOURCE "spip-3.1.zip"
2015-04-28 17:05:35 +02:00
# Set permissions to spip directory
2015-04-28 17:05:35 +02:00
sudo chown -R www-data: $final_path
# Modify Nginx configuration file and copy it to Nginx conf directory
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
2015-04-28 19:58:18 +02:00
sed -i "s@ALIASTOCHANGE@$final_path@g" ../conf/nginx.conf
2015-04-28 17:05:35 +02:00
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/spip.conf
2016-09-20 01:51:28 +02:00
POOL_FPM
2015-04-28 18:46:07 +02:00
2015-04-28 17:05:35 +02:00
# Reload Nginx and regenerate SSOwat conf
2015-04-28 18:46:07 +02:00
sudo service php5-fpm restart
2015-04-28 17:05:35 +02:00
sudo service nginx reload
2015-04-28 17:54:25 +02:00
sudo yunohost app setting spip skipped_uris -v "/"
2016-09-20 01:51:28 +02:00
sudo yunohost app ssowatconf