mirror of
https://github.com/YunoHost-Apps/ampache_ynh.git
synced 2024-09-03 18:15:55 +02:00
Error in scripts when using subdomain
This commit is contained in:
parent
2e020488f1
commit
a2eed0379a
2 changed files with 4 additions and 11 deletions
|
@ -7,9 +7,6 @@ admin_ampache=$3
|
||||||
|
|
||||||
debianversionname=$(lsb_release -a | grep Codename | awk -F' ' '{print $2}')
|
debianversionname=$(lsb_release -a | grep Codename | awk -F' ' '{print $2}')
|
||||||
|
|
||||||
# Remove trailing "/" for next commands
|
|
||||||
path=${path%/}
|
|
||||||
|
|
||||||
# Check domain/path availability
|
# Check domain/path availability
|
||||||
sudo yunohost app checkurl $domain$path -a ampache
|
sudo yunohost app checkurl $domain$path -a ampache
|
||||||
if [[ ! $? -eq 0 ]]; then
|
if [[ ! $? -eq 0 ]]; then
|
||||||
|
@ -47,7 +44,7 @@ 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/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/yunobase/$db_user/g" $final_path/config/ampache.cfg.php
|
||||||
sudo sed -i "s/yunoadmin/$admin_ampache/g" /tmp/admin.sql
|
sudo sed -i "s/yunoadmin/$admin_ampache/g" /tmp/admin.sql
|
||||||
sudo sed -i "s@PATHTOCHANGE@$path@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
|
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')
|
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')
|
||||||
sudo 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
|
||||||
|
@ -72,7 +69,7 @@ sudo apt-get install ffmpeg -y
|
||||||
# Ampache installation
|
# Ampache installation
|
||||||
echo "127.0.0.1 $domain #yunoampache" | sudo tee -a /etc/hosts
|
echo "127.0.0.1 $domain #yunoampache" | sudo tee -a /etc/hosts
|
||||||
sleep 1
|
sleep 1
|
||||||
curl -kL -X POST http://$domain$path/update.php?action=update > /dev/null 2>&1
|
curl -kL -X POST http://$domain${path%/}/update.php?action=update > /dev/null 2>&1
|
||||||
sleep 5
|
sleep 5
|
||||||
[ "$debianversionname" == "wheezy" ] && \
|
[ "$debianversionname" == "wheezy" ] && \
|
||||||
sudo sed -i 's/;transcode_cmd = "ffmpeg"/transcode_cmd = "ffmpeg"/g' /var/www/ampache/config/ampache.cfg.php && \
|
sudo sed -i 's/;transcode_cmd = "ffmpeg"/transcode_cmd = "ffmpeg"/g' /var/www/ampache/config/ampache.cfg.php && \
|
||||||
|
|
|
@ -10,10 +10,6 @@ db_user=ampache
|
||||||
db_pwd=$(sudo yunohost app setting ampache mysqlpwd)
|
db_pwd=$(sudo yunohost app setting ampache mysqlpwd)
|
||||||
admin_ampache=$(sudo yunohost app setting ampache admin)
|
admin_ampache=$(sudo yunohost app setting ampache admin)
|
||||||
|
|
||||||
# Remove trailing "/" for next commands
|
|
||||||
path=${path%/}
|
|
||||||
|
|
||||||
|
|
||||||
# first make a copy of the db
|
# 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
|
||||||
|
|
||||||
|
@ -26,7 +22,7 @@ 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/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/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/yunobase/$db_user/g" $final_path/config/ampache.cfg.php
|
||||||
sudo sed -i "s@PATHTOCHANGE@$path@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
|
sudo sed -i "s@DOMAINTOCHANGE@$domain@g" $final_path/config/ampache.cfg.php
|
||||||
|
|
||||||
|
|
||||||
|
@ -47,7 +43,7 @@ sudo yunohost app ssowatconf
|
||||||
# Ampache installation
|
# Ampache installation
|
||||||
echo "127.0.0.1 $domain #yunoampache" | sudo tee -a /etc/hosts
|
echo "127.0.0.1 $domain #yunoampache" | sudo tee -a /etc/hosts
|
||||||
sleep 1
|
sleep 1
|
||||||
curl -kL -X POST http://$domain$path/update.php?action=update > /dev/null 2>&1
|
curl -kL -X POST http://$domain${path%/}/update.php?action=update > /dev/null 2>&1
|
||||||
sleep 5
|
sleep 5
|
||||||
[ "$debianversionname" == "wheezy" ] && \
|
[ "$debianversionname" == "wheezy" ] && \
|
||||||
sudo sed -i 's/;transcode_cmd = "ffmpeg"/transcode_cmd = "ffmpeg"/g' /var/www/ampache/config/ampache.cfg.php && \
|
sudo sed -i 's/;transcode_cmd = "ffmpeg"/transcode_cmd = "ffmpeg"/g' /var/www/ampache/config/ampache.cfg.php && \
|
||||||
|
|
Loading…
Add table
Reference in a new issue