From 4562cf832eba2dcc164ecbc8db937cce76d3371d Mon Sep 17 00:00:00 2001 From: Moul Date: Tue, 29 Dec 2015 22:45:24 +0400 Subject: [PATCH] Add CPU limit. --- manifest.json | 7 +++++++ manifest.json.future | 7 ------- scripts/install | 5 ++--- 3 files changed, 9 insertions(+), 10 deletions(-) delete mode 100644 manifest.json.future diff --git a/manifest.json b/manifest.json index 7d1da1c..8a902b3 100644 --- a/manifest.json +++ b/manifest.json @@ -76,6 +76,13 @@ "en": "Password of your account", "fr": "Mot de passe de votre compte" } + }, + { + "name": "cpu", + "ask": { + "en": "Which CPU load limit would you like your uCoin node don't exceed?", + "fr": "Quel pourcentage de charge processeur ne souhaitez-vous pas que le nœud uCoin dépasse ?" + } } ] } diff --git a/manifest.json.future b/manifest.json.future deleted file mode 100644 index 9ce5eab..0000000 --- a/manifest.json.future +++ /dev/null @@ -1,7 +0,0 @@ - { - "name": "cpu", - "ask": { - "en": "Which CPU load limit would you like your uCoin node don't exceed?", - "fr": "Quel pourcentage de charge processeur ne souhaitez-vous pas que le nÅ<93>ud uCoin dÃpasse ?" - } - } diff --git a/scripts/install b/scripts/install index 66b872e..62d397c 100755 --- a/scripts/install +++ b/scripts/install @@ -11,8 +11,7 @@ sync_node=$4 sync_port=$5 salt=$6 password=$7 -#cpu=$(($7/100)) -#cpu=`expr $7 / 100` +cpu=`bc -l <<< "scale=2; $8/100"` # Check domain/path availability sudo yunohost app checkurl $domain$path -a $app @@ -47,7 +46,7 @@ UCOIN_DIR="/home/admin/.ucoin" # Configure uCoin node ucoind init --autoconf -ucoind config --remoteh $domain --port $port --remotep $port --salt $salt --passwd $password # --cpu $cpu +ucoind config --remoteh $domain --port $port --remotep $port --salt $salt --passwd $password --cpu $cpu # Synchronize uCoin node echo "Synchronizing with $sync_node:$sync_port. It may take a while. More than ten minutes"