1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/cops_ynh.git synced 2024-09-03 18:25:57 +02:00

New check_process file

This commit is contained in:
polytan02 2016-12-24 00:33:21 +00:00
parent 83ec1668dc
commit 06d50b9d1e
3 changed files with 33 additions and 17 deletions

32
check_process Normal file
View file

@ -0,0 +1,32 @@
;; master
auto_remove=1
# Commentaire ignoré
; Manifest
domain="$DOMAIN" (DOMAIN)
path="$PATH" (PATH)
language="fr"
runninguser
calibre
is_public=1 (PUBLIC|public=1|private=0)
basicauthcreate
basicauthname
basicauthpass
# password="$PASSWORD" (PASSWORD)
# port="666" (PORT)
; Checks
pkg_linter=1
setup_sub_dir=1
setup_root=1
setup_nourl=0
setup_private=1
setup_public=1
upgrade=1
backup_restore=1
multi_instance=1
wrong_user=0
wrong_path=1
incorrect_path=1
corrupt_source=0
fail_download_source=0
port_already_use=0 (XXXX)
final_path_already_use=0

View file

@ -41,15 +41,6 @@
"example": "/cops", "example": "/cops",
"default": "/cops" "default": "/cops"
}, },
{
"name": "admin",
"type": "user",
"ask": {
"en": "Choose the COPS administrator (must be an existing YunoHost user)",
"fr": "Choisissez l'administrateur de COPS (doit être un utilisateur YunoHost existant)"
},
"example": "homer"
},
{ {
"name": "calibre", "name": "calibre",
"ask": { "ask": {
@ -97,6 +88,7 @@
}, },
{ {
"name": "basicauthpass", "name": "basicauthpass",
"type": "password",
"ask": { "ask": {
"en": "Choose the password to access the OPDS/HTML server", "en": "Choose the password to access the OPDS/HTML server",
"fr": "Renseignez le mot de passe pour accéder au serveur OPDS/HTML" "fr": "Renseignez le mot de passe pour accéder au serveur OPDS/HTML"

View file

@ -14,7 +14,6 @@ source /usr/share/yunohost/helpers
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
domain=$YNH_APP_ARG_DOMAIN domain=$YNH_APP_ARG_DOMAIN
path=$YNH_APP_ARG_PATH path=$YNH_APP_ARG_PATH
admin=$YNH_APP_ARG_ADMIN
is_public=$YNH_APP_ARG_IS_PUBLIC is_public=$YNH_APP_ARG_IS_PUBLIC
runninguser=$YNH_APP_ARG_RUNNINGUSER runninguser=$YNH_APP_ARG_RUNNINGUSER
calibre=$YNH_APP_ARG_CALIBRE calibre=$YNH_APP_ARG_CALIBRE
@ -31,13 +30,6 @@ CHECK_VAR () { # Vérifie que la variable n'est pas vide.
CHECK_VAR "$app" "app name not set" CHECK_VAR "$app" "app name not set"
# Check admin user
CHECK_USER () { # Vérifie la validité de l'user admin
# $1 = Variable de l'user admin.
ynh_user_exists "$1" || (echo "Wrong admin" >&2 && false)
}
CHECK_USER "$admin"
# Check the path value and correct it (adds / at begining and removes it at the end) # Check the path value and correct it (adds / at begining and removes it at the end)
CHECK_PATH () { # Vérifie la présence du / en début de path. Et son absence à la fin. CHECK_PATH () { # Vérifie la présence du / en début de path. Et son absence à la fin.
if [ "${path:0:1}" != "/" ]; then # Si le premier caractère n'est pas un / if [ "${path:0:1}" != "/" ]; then # Si le premier caractère n'est pas un /