mirror of
https://github.com/YunoHost-Apps/headphones_ynh.git
synced 2024-09-03 19:26:02 +02:00
9026d270c8
import files
39 lines
777 B
Bash
39 lines
777 B
Bash
#!/bin/bash
|
|
|
|
# Set variables
|
|
app_id=headphones
|
|
app_user=headphones
|
|
app_install_dir=/opt/yunohost/$app_id
|
|
app_init_file=$app_install_dir/init-scripts/init.ubuntu
|
|
app_host=$(sudo yunohost app setting $app_id host)
|
|
|
|
# Make upgrade if localhost installation
|
|
if [[ $app_host == "127.0.0.1" ]]; then
|
|
|
|
# Kill App
|
|
sudo service $app_id stop
|
|
sudo killall $app_id
|
|
|
|
# Upgrade to the latest version of App using the fork
|
|
cd $app_install_dir && sudo git pull
|
|
cd -
|
|
|
|
# Upgrade dependencies
|
|
|
|
# Update init file
|
|
sudo cp -a $app_init_file /etc/init.d/$app_id
|
|
|
|
# Set rights
|
|
sudo chown -R $app_user $app_install_dir
|
|
sudo chmod +x /etc/init.d/$app_id
|
|
sudo chmod +x -R $app_install_dir
|
|
|
|
# Reload daemon
|
|
sudo service $app_id restart
|
|
|
|
fi
|
|
|
|
|
|
# Reload Nginx
|
|
sudo service nginx reload
|
|
|