mirror of
https://github.com/YunoHost-Apps/phpsysinfo_ynh.git
synced 2024-09-03 19:56:43 +02:00
Add $app and set -eu
This commit is contained in:
parent
68a75877f0
commit
e7ec50b2a2
3 changed files with 21 additions and 3 deletions
|
@ -1,8 +1,14 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Exit on command errors and treat unset variables as an error
|
||||||
|
set -eu
|
||||||
|
|
||||||
# Define app
|
# Define app
|
||||||
app=phpsysinfo
|
app=phpsysinfo
|
||||||
|
|
||||||
|
# Source YunoHost helpers
|
||||||
|
. /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# Retrieve arguments
|
# Retrieve arguments
|
||||||
domain=$1
|
domain=$1
|
||||||
path=$2
|
path=$2
|
||||||
|
@ -22,7 +28,7 @@ if [[ ! $? -eq 0 ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Copy files to the right place
|
# Copy files to the right place
|
||||||
final_path=/var/www/phpsysinfo
|
final_path=/var/www/$app
|
||||||
sudo mkdir -p $final_path
|
sudo mkdir -p $final_path
|
||||||
sudo cp -a ../sources/* $final_path
|
sudo cp -a ../sources/* $final_path
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Exit on command errors and treat unset variables as an error
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
# Source YunoHost helpers
|
||||||
|
. /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# Define app
|
# Define app
|
||||||
app=phpsysinfo
|
app=phpsysinfo
|
||||||
|
|
||||||
|
@ -10,7 +16,7 @@ admin=$(ynh_app_setting_get "$app" admin)
|
||||||
is_public=$(ynh_app_setting_get "$app" is_public)
|
is_public=$(ynh_app_setting_get "$app" is_public)
|
||||||
|
|
||||||
# Remove sources
|
# Remove sources
|
||||||
sudo rm -rf /var/www/phpsysinfo
|
sudo rm -rf /var/www/$app
|
||||||
|
|
||||||
# Remove configuration files
|
# Remove configuration files
|
||||||
sudo rm -f /etc/nginx/conf.d/$domain.d/phpsysinfo.conf
|
sudo rm -f /etc/nginx/conf.d/$domain.d/phpsysinfo.conf
|
||||||
|
|
|
@ -1 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Exit on command errors and treat unset variables as an error
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
# Source YunoHost helpers
|
||||||
|
. /usr/share/yunohost/helpers
|
Loading…
Add table
Reference in a new issue