1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ethercalc_ynh.git synced 2024-09-03 18:26:36 +02:00

[enh] Add expire option

[enh] Translate manifest in french
This commit is contained in:
zamentur 2014-12-08 01:10:44 +01:00
parent 58412cc4c3
commit 6b7ce597fa
3 changed files with 27 additions and 5 deletions

View file

@ -25,7 +25,7 @@ set -e
start() {
echo "Starting $DESC... "
start-stop-daemon --start --chuid "$USER:$GROUP" --chdir $EPLITE_DIR --background --make-pidfile --pidfile /var/run/$NAME.pid --startas /bin/bash -- -c "exec $EPLITE_DIR/$EPLITE_BIN --port YUNOPORT --basepath YUNOPATH > $LOGFILE 2>&1"
start-stop-daemon --start --chuid "$USER:$GROUP" --chdir $EPLITE_DIR --background --make-pidfile --pidfile /var/run/$NAME.pid --startas /bin/bash -- -c "exec $EPLITE_DIR/$EPLITE_BIN --port YUNOPORT --basepath YUNOPATH YUNOEXPIRE > $LOGFILE 2>&1"
echo "done"
}

View file

@ -2,7 +2,8 @@
"name": "EtherCalc",
"id": "ethercalc",
"description": {
"en": "online web spreadsheet editor providing collaborative editing in really real-time"
"en": "Online web spreadsheet editor providing collaborative editing in really real-time",
"fr": "Feuille de calcul collaborative en ligne"
},
"developer": {
"name": "zamentur",
@ -14,15 +15,19 @@
"install" : [
{
"name": "domain",
"type": "domain",
"ask": {
"en": "Choose a domain for EtherCalc"
"en": "Choose a domain for EtherCalc",
"fr": "Choisissez un domaine pour EterCalc"
},
"example": "domain.org"
},
{
"name": "path",
"type": "path",
"ask": {
"en": "Choose a path for EtherCalc"
"en": "Choose a path for EtherCalc",
"fr": "Choisissez un chemin pour EterCalc"
},
"example": "/calc",
"default": "/calc"
@ -30,10 +35,19 @@
{
"name": "public_site",
"ask": {
"en": "Is it a public EtherCalc ?"
"en": "Is it a public EtherCalc ?",
"fr": "Des personnes n'ayant pas de compte Yunohost peuvent elles utiliser ce EtherCalc ?"
},
"choices": ["Yes", "No"],
"default": "Yes"
},
{
"name": "expire",
"ask": {
"en": "Deletes a spreadsheet's content after N days of inactivity. (0 to diasable this feature)",
"fr": "Suppression après N jours d'inactivités. (0 pour désactiver cette fonctionnalité)"
},
"default": "0"
}

View file

@ -8,6 +8,7 @@ instance_number=$(echo $app | sed 's/[^0-9]//g')
domain=$1
path=$2
is_public=$3
expire=$4
port=$((instance_number+8000))
# Check domain/path availability
@ -19,6 +20,7 @@ fi
echo "Register configuration..."
sudo yunohost app setting $app is_public -v $is_public
sudo yunohost app setting $app port -v $port
sudo yunohost app setting $app expire -v $expire
# Remove trailing "/" for next commands
path=${path%/}
@ -48,6 +50,12 @@ sed -i "s@YUNOPORT@$port@g" ../conf/$name
sed -i "s@YUNOLOG@$app@g" ../conf/$name
sed -i "s@YUNOPATH@$path@g" ../conf/$name
sed -i "s@YUNOAPP@$app@g" ../conf/$name
if [ "$expire" -eq 0 ]; then
expire=""
else
expire="--expire $(($expire * 86400))"
fi
sed -i "s@YUNOEXPIRE@$expire@g" ../conf/$name
sudo cp ../conf/$name /etc/init.d/$app
sudo chmod +x /etc/init.d/$app
sudo update-rc.d $app defaults