mirror of
https://github.com/YunoHost-Apps/cheky_ynh.git
synced 2024-09-03 18:16:00 +02:00
fix automated upgrade
This commit is contained in:
parent
5af9dc26f5
commit
c368ad4bfe
2 changed files with 10 additions and 21 deletions
|
@ -124,18 +124,9 @@ ynh_print_info "Running specific upgrade..."
|
||||||
# Give full access to "$app" so php script can do "its own magic stuff"
|
# Give full access to "$app" so php script can do "its own magic stuff"
|
||||||
chown -R $app: $final_path
|
chown -R $app: $final_path
|
||||||
|
|
||||||
#exec_as "$app" "/usr/bin/php $YNH_CWD/upgrade_cheky.php $final_path"
|
# Copy Yunohost custom script to cheky folder and launch it
|
||||||
sudo -u "$app" "/usr/bin/php $YNH_CWD/upgrade_cheky.php $final_path"
|
cp yunohost_upgrade_cheky.php $final_path/others/update/
|
||||||
|
exec_as "$app" /usr/bin/php $final_path/others/update/yunohost_upgrade_cheky.php $final_path
|
||||||
#=================================================
|
|
||||||
# CONFIGURE HOOKS
|
|
||||||
#=================================================
|
|
||||||
### TODO: Better to use a hook like "post_app_upgrade" ?
|
|
||||||
#ynh_print_info "Running post upgrade recipe..."
|
|
||||||
|
|
||||||
#ynh_replace_string "__FINALPATH__" "$final_path" "../hooks/post_app_install"
|
|
||||||
#ynh_replace_string "__FINALPATH__" "$final_path" "../hooks/post_app_remove"
|
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
// Script d'upgrade custom pour automatiser la MAJ sans action de l'utilisateur
|
||||||
// source: https://forum.cheky.net/mise-a-jour-de-cheky-en-ligne-de-commande-t659-p1.html#p2624
|
// source: https://forum.cheky.net/mise-a-jour-de-cheky-en-ligne-de-commande-t659-p1.html#p2624
|
||||||
|
|
||||||
//$root_path = "__FINALPATH__";
|
//$root_path = "__FINALPATH__";
|
||||||
|
@ -19,8 +19,6 @@ if ($storageType == "db") {
|
||||||
$userStorage = new \App\Storage\File\User(DOCUMENT_ROOT."/var/users.db");
|
$userStorage = new \App\Storage\File\User(DOCUMENT_ROOT."/var/users.db");
|
||||||
}
|
}
|
||||||
|
|
||||||
//require $root_path."/bootstrap.php";
|
|
||||||
|
|
||||||
$_POST = array(
|
$_POST = array(
|
||||||
"upgrade" => 1,
|
"upgrade" => 1,
|
||||||
);
|
);
|
||||||
|
@ -29,9 +27,9 @@ require $root_path."/app/admin/scripts/upgrade.php";
|
||||||
|
|
||||||
// S'il y a des erreurs, on les écrit dans STDERR et on quitte
|
// S'il y a des erreurs, on les écrit dans STDERR et on quitte
|
||||||
// avec un code erreur.
|
// avec un code erreur.
|
||||||
#if (!empty($errors)) {
|
if (!empty($errors)) {
|
||||||
# fwrite(STDERR, str_replace(
|
fwrite(STDERR, str_replace(
|
||||||
# array("<br>", "<br />"), "", implode("\n", $errors)
|
array("<br>", "<br />"), "", implode("\n", $errors)
|
||||||
# );
|
));
|
||||||
# exit(1);
|
exit(1);
|
||||||
#}
|
}
|
Loading…
Add table
Reference in a new issue