From 2e020488f1fea9e5708844888af840f338d041f8 Mon Sep 17 00:00:00 2001 From: Steven Roose Date: Sat, 29 Aug 2015 01:05:00 +0200 Subject: [PATCH] Errors in scripts --- scripts/install | 6 +++--- scripts/upgrade | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/install b/scripts/install index b7af813..a3bf986 100644 --- a/scripts/install +++ b/scripts/install @@ -47,10 +47,10 @@ sudo sed -i "s/yunouser/$db_user/g" $final_path/config/ampache.cfg.php sudo sed -i "s/yunopass/$db_pwd/g" $final_path/config/ampache.cfg.php sudo sed -i "s/yunobase/$db_user/g" $final_path/config/ampache.cfg.php sudo sed -i "s/yunoadmin/$admin_ampache/g" /tmp/admin.sql -sed -i "s@PATHTOCHANGE@$path@g" $final_path/config/ampache.cfg.php -sed -i "s@DOMAINTOCHANGE@$domain@g" $final_path/config/ampache.cfg.php +sudo sed -i "s@PATHTOCHANGE@$path@g" $final_path/config/ampache.cfg.php +sudo sed -i "s@DOMAINTOCHANGE@$domain@g" $final_path/config/ampache.cfg.php random_key=db_pwd=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d '[A-Za-z0-9]' | sed -n 's/\(.\{24\}\).*/\1/p') -sed -i "s@RANDOMKEYTOCHANGE@$random_key@g" $final_path/config/ampache.cfg.php +sudo sed -i "s@RANDOMKEYTOCHANGE@$random_key@g" $final_path/config/ampache.cfg.php # Set permissions to ampache directory sudo chown -R www-data: $final_path diff --git a/scripts/upgrade b/scripts/upgrade index 9a9877b..e8eeb78 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -4,18 +4,18 @@ debianversionname=$(lsb_release -a | grep Codename | awk -F' ' '{print $2}') # Retrieve arguments -domain=$(sudo yunohost app setting syncthing domain) -path=$(sudo yunohost app setting syncthing path) +domain=$(sudo yunohost app setting ampache domain) +path=$(sudo yunohost app setting ampache path) db_user=ampache -db_pwd=$(sudo yunohost app setting syncthing mysqlpwd) -admin_ampache=$(sudo yunohost app setting syncthing admin) +db_pwd=$(sudo yunohost app setting ampache mysqlpwd) +admin_ampache=$(sudo yunohost app setting ampache admin) # Remove trailing "/" for next commands path=${path%/} # first make a copy of the db -mysqldump -u $db_user -p$db_pwd --add-drop-table --allow-keywords ampache > $final_path/ampache-db-backup.sql +# mysqldump -u $db_user -p$db_pwd --add-drop-table --allow-keywords ampache > $final_path/ampache-db-backup.sql # Copy files to the right place final_path=/var/www/ampache @@ -26,8 +26,8 @@ sudo cp ../conf/ampache.cfg.php $final_path/config/ampache.cfg.php sudo sed -i "s/yunouser/$db_user/g" $final_path/config/ampache.cfg.php sudo sed -i "s/yunopass/$db_pwd/g" $final_path/config/ampache.cfg.php sudo sed -i "s/yunobase/$db_user/g" $final_path/config/ampache.cfg.php -sed -i "s@PATHTOCHANGE@$path@g" $final_path/config/ampache.cfg.php -sed -i "s@DOMAINTOCHANGE@$domain@g" $final_path/config/ampache.cfg.php +sudo sed -i "s@PATHTOCHANGE@$path@g" $final_path/config/ampache.cfg.php +sudo sed -i "s@DOMAINTOCHANGE@$domain@g" $final_path/config/ampache.cfg.php # Set permissions to roundcube directory