mirror of
https://github.com/YunoHost-Apps/vaultwarden_ynh.git
synced 2024-09-03 18:26:31 +02:00
commit
9315713ba6
2 changed files with 2 additions and 2 deletions
|
@ -119,6 +119,7 @@ if [ -z $datadir ]; then
|
||||||
mkdir -p $datadir
|
mkdir -p $datadir
|
||||||
rsync -arz "$final_path/live/data/" "$datadir/" --delete-after --remove-source-files
|
rsync -arz "$final_path/live/data/" "$datadir/" --delete-after --remove-source-files
|
||||||
ynh_secure_remove --file="$final_path/live/data"
|
ynh_secure_remove --file="$final_path/live/data"
|
||||||
|
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||||
chmod 750 "$datadir"
|
chmod 750 "$datadir"
|
||||||
chmod -R o-rwx "$datadir"
|
chmod -R o-rwx "$datadir"
|
||||||
chown -R $app:$app "$datadir"
|
chown -R $app:$app "$datadir"
|
||||||
|
|
|
@ -198,8 +198,7 @@ ynh_handle_app_migration () {
|
||||||
old_db_name=$(ynh_app_setting_get --app=$old_app --key=db_name)
|
old_db_name=$(ynh_app_setting_get --app=$old_app --key=db_name)
|
||||||
|
|
||||||
# Check if a database exists before trying to move it
|
# Check if a database exists before trying to move it
|
||||||
local mysql_root_password=$(cat $MYSQL_ROOT_PWD_FILE)
|
if [ -n "$old_db_name" ] && mysqlshow | grep -q "^| $old_db_name"
|
||||||
if [ -n "$old_db_name" ] && mysqlshow -u root -p$mysql_root_password | grep -q "^| $old_db_name"
|
|
||||||
then
|
then
|
||||||
old_db_user=$old_db_name
|
old_db_user=$old_db_name
|
||||||
db_pwd=$(ynh_app_setting_get --app=$old_app --key=mysqlpwd)
|
db_pwd=$(ynh_app_setting_get --app=$old_app --key=mysqlpwd)
|
||||||
|
|
Loading…
Reference in a new issue