Browse Source

Update to last commits from 486

pull/47/head
Maniack Crudelis 8 years ago
parent
commit
9386677ad7
  1. 18
      actions.json
  2. 10
      scripts/actions/public_private

18
actions.json

@ -1,22 +1,20 @@
{
"public_private": {
[{
"id": "public_private",
"name": "Move to public or private", "name": "Move to public or private",
"command": "/bin/bash $YNH_APP_ID/scripts/actions/public_private",
"command": "/bin/bash scripts/actions/public_private",
"user": "root", "user": "root",
"cwd": "/etc/yunohost/apps/",
"accepted_return_codes": [0, 1, 2, 3],
"accepted_return_codes": [0],
"description": { "description": {
"en": "Change the public access of the app." "en": "Change the public access of the app."
}, },
"arguments": [ "arguments": [
{ {
"name": "is_public", "name": "is_public",
"type": "string",
"type": "boolean",
"ask": { "ask": {
"en": "Is it a public app ? (yes/no)"
"en": "Is it a public app ? (1/0) (1=yes; 0=no)"
}, },
"example": "yes, no"
"default": true
} }
] ]
}
}
}]

10
scripts/actions/public_private

@ -21,16 +21,6 @@ app=$YNH_APP_ID
# CHECK IF ARGUMENTS ARE CORRECT # CHECK IF ARGUMENTS ARE CORRECT
#================================================= #=================================================
if [ "$is_public" = "y" ] || [ "$is_public" = "yes" ]; then
is_public=1
elif [ "$is_public" = "n" ] || [ "$is_public" = "no" ]; then
is_public=0
fi
if [ "$is_public" != "0" ] && [ "$is_public" != "1" ]; then
ynh_die "Argument is_public is incorrect, should be 'yes' or 'no'"
fi
#================================================= #=================================================
# CHECK IF AN ACTION HAS TO BE DONE # CHECK IF AN ACTION HAS TO BE DONE
#================================================= #=================================================

Loading…
Cancel
Save