From 2073e80de41de05351875a57286fb70b8d7dd547 Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 10 Feb 2024 20:17:38 +0100 Subject: [PATCH] leading zero removed --- setup.sh | 2 +- tools/MOATS2seconds.sh | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/setup.sh b/setup.sh index 6098b39b..95080735 100755 --- a/setup.sh +++ b/setup.sh @@ -120,7 +120,7 @@ fi if [[ ! $(cat /etc/hosts | grep -w "astroport.local" | head -n 1) ]]; then cat /etc/hosts > /tmp/hosts - echo "127.0.1.1 $(hostname) $(hostname).local astroport.$(hostname).local ipfs.$(hostname).local astroport.local" >> /tmp/hosts + echo "127.0.1.1 $(hostname) $(hostname).local astroport.$(hostname).local ipfs.$(hostname).local astroport.local duniter.localhost" >> /tmp/hosts sudo cp /tmp/hosts /etc/hosts && rm /tmp/hosts fi diff --git a/tools/MOATS2seconds.sh b/tools/MOATS2seconds.sh index 8edfc956..51d5affa 100755 --- a/tools/MOATS2seconds.sh +++ b/tools/MOATS2seconds.sh @@ -12,16 +12,20 @@ DAYS_IN_MONTH=30 YEAR=${Zmoats:0:4} SECYEAR=$((YEAR * 365 * 24 * 3600)) -MONTH=$((${Zmoats:4:2}+0)) +MONTH=${Zmoats:4:2} +MONTH=${MONTH#0} SECMONTH=$((MONTH * DAYS_IN_MONTH * 24 * 3600)) -DAY=$((${Zmoats:6:2}+0)) +DAY=${Zmoats:6:2} +DAY=${DAY#0} SECDAY=$((DAY * 24 * 3600)) -HOUR=$((${Zmoats:8:2}+0)) +HOUR=${Zmoats:8:2} +HOUR=${HOUR#0} SECHOUR=$((HOUR * 3600)) -MINUTE=$((${Zmoats:10:2}+0)) +MINUTE=${Zmoats:10:2} +MINUTE=${MINUTE#0} SECMINUTE=$((MINUTE * 60)) SECOND=$((${Zmoats:12:2}+0))