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

adding pushd / popd

This commit is contained in:
yalh76 2019-02-02 03:03:50 +01:00
parent f8b3b9aeb4
commit 097c138c71
3 changed files with 12 additions and 8 deletions

View file

@ -17,7 +17,7 @@ port = 3306
[app]
site_name = __SITENAME__
site_description = __SITEDESCRIPTION__
host = https://your-writefreely-url-instance.com
host = __DOMAIN_URL__
theme = write
disable_js = false
webfonts = true

View file

@ -76,7 +76,7 @@ app=$YNH_APP_INSTANCE_NAME
### If the app uses nginx as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app".
### If the app provides an internal web server (or uses another application server such as uwsgi), the final path should be "/opt/yunohost/$app"
final_path=/var/www/$app
final_path="/var/www/$app"
test ! -e "$final_path" || ynh_die "This path already contains a folder"
# Normalize the url path syntax
@ -258,13 +258,13 @@ ynh_add_systemd_config
### (It's compatible with sed regular expressions syntax)
# setup application config
sudo cp ../conf/config.ini $final_path/config.ini
sudo cp "../conf/config.ini" "$final_path/config.ini"
ynh_replace_string "__DBNAME__" "$db_name" "$final_path/config.ini"
ynh_replace_string "__DBUSER__" "$db_name" "$final_path/config.ini"
ynh_replace_string "__DBPWD__" "$db_pwd" "$final_path/config.ini"
ynh_replace_string "__PORT__" "$port" "$final_path/config.ini"
ynh_replace_string "https://your-writefreely-url-instance.com" "https://$domain$path_url" "$final_path/config.ini"
ynh_replace_string "__DOMAIN_URL__" "https://$domain$path_url" "$final_path/config.ini"
ynh_replace_string "__SINGLEUSER__" "$single_user" "$final_path/config.ini"
ynh_replace_string "__SITENAME__" "$site_name" "$final_path/config.ini"
ynh_replace_string "__SITEDESCRIPTION__" "$site_description" "$final_path/config.ini"
@ -299,9 +299,11 @@ chown -R "$app":"$app" "/var/log/$app"
# MAKE SETUP
#=================================================
( cd $final_path && $final_path/writefreely --init-db )
( cd $final_path && $final_path/writefreely --gen-keys )
( cd $final_path && $final_path/writefreely --create-admin $admin:$password )
pushd $final_path
sudo -u $app ./writefreely --init-db
sudo -u $app ./writefreely --gen-keys
sudo -u $app ./writefreely --create-admin "$admin":"$password"
popd
#=================================================
# GENERIC FINALIZATION

View file

@ -139,7 +139,9 @@ ynh_system_user_create "$app" "$final_path"
# MAKE UPGRADE
#=================================================
( cd $final_path && $final_path/writefreely --migrate )
pushd $final_path
sudo -u $app ./writefreely --migrate
popd
### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script.
### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it.