leading zero removed

This commit is contained in:
fred 2024-02-10 20:17:38 +01:00
parent 9d9d0e722e
commit 2073e80de4
2 changed files with 9 additions and 5 deletions

View File

@ -120,7 +120,7 @@ fi
if [[ ! $(cat /etc/hosts | grep -w "astroport.local" | head -n 1) ]]; then if [[ ! $(cat /etc/hosts | grep -w "astroport.local" | head -n 1) ]]; then
cat /etc/hosts > /tmp/hosts 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 sudo cp /tmp/hosts /etc/hosts && rm /tmp/hosts
fi fi

View File

@ -12,16 +12,20 @@ DAYS_IN_MONTH=30
YEAR=${Zmoats:0:4} YEAR=${Zmoats:0:4}
SECYEAR=$((YEAR * 365 * 24 * 3600)) SECYEAR=$((YEAR * 365 * 24 * 3600))
MONTH=$((${Zmoats:4:2}+0)) MONTH=${Zmoats:4:2}
MONTH=${MONTH#0}
SECMONTH=$((MONTH * DAYS_IN_MONTH * 24 * 3600)) SECMONTH=$((MONTH * DAYS_IN_MONTH * 24 * 3600))
DAY=$((${Zmoats:6:2}+0)) DAY=${Zmoats:6:2}
DAY=${DAY#0}
SECDAY=$((DAY * 24 * 3600)) SECDAY=$((DAY * 24 * 3600))
HOUR=$((${Zmoats:8:2}+0)) HOUR=${Zmoats:8:2}
HOUR=${HOUR#0}
SECHOUR=$((HOUR * 3600)) SECHOUR=$((HOUR * 3600))
MINUTE=$((${Zmoats:10:2}+0)) MINUTE=${Zmoats:10:2}
MINUTE=${MINUTE#0}
SECMINUTE=$((MINUTE * 60)) SECMINUTE=$((MINUTE * 60))
SECOND=$((${Zmoats:12:2}+0)) SECOND=$((${Zmoats:12:2}+0))