@@ -12,7 +12,6 @@ YELLOW='\033[0;33m'
12
12
RED=' \033[0;31m'
13
13
NC=' \033[0m' # No Color
14
14
15
- _AUTO_UPDATE_=N
16
15
_NEED_INSTALL_=0
17
16
_PLUGINS_CHANGE_=0
18
17
@@ -345,10 +344,10 @@ function startupNode() {
345
344
function checkAndCleanAutoUpdate() {
346
345
ps -ef | grep " $IOTEX_HOME /bin/auto-update" | grep -v grep > /dev/null 2>&1
347
346
if [ $? -eq 0 ]; then
347
+ echo -e " ${YELLOW} ****** Detect the auto-update is running , it will stop and clean ******* ${NC} "
348
348
pid=$( ps -ef | grep " $IOTEX_HOME /bin/auto-update" | grep -v grep | awk ' {print $2}' )
349
349
kill -9 $pid > /dev/null 2>&1
350
350
rm -f $IOTEX_HOME /bin/auto-update $IOTEX_HOME /bin/update_silence.sh
351
- _AUTO_UPDATE_=Y
352
351
fi
353
352
}
354
353
@@ -382,16 +381,6 @@ function main() {
382
381
383
382
# Interactive setup phase
384
383
read -p " Do you want to monitor the status of the node [Y/N] (Default: N)? " wantmonitor
385
- if [ " ${_AUTO_UPDATE_} X" != " YX" ]; then
386
- read -p " Do you want to auto update the node [Y/N] (Default: N)? " _AUTO_UPDATE_
387
- # To upper
388
- if [ " ${_AUTO_UPDATE_} X" = " nX" ]; then
389
- _AUTO_UPDATE_=N
390
- fi
391
- if [ " ${_AUTO_UPDATE_} X" = " yX" ]; then
392
- _AUTO_UPDATE_=Y
393
- fi
394
- fi
395
384
396
385
if [ $_PLUGINS_ ] && [ " $_PLUGINS_ " X = " gateway" X ]; then
397
386
plugins=Y
@@ -406,8 +395,7 @@ function main() {
406
395
fi
407
396
408
397
# Get the latest version.
409
- lastversion=$( curl -sS https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/master/README.md| grep " ^- $_GREP_STRING_ :" | awk ' {print $3}' )
410
-
398
+ lastversion=$( curl -sS https://api.github.com/repos/iotexproject/iotex-core/releases/latest| grep -oP ' (?<="tag_name": ")[^"]*' )
411
399
echo -e " Current operating environment: ${YELLOW} $env ${NC} "
412
400
read -p " Install or Upgrade Version; if null the latest [$lastversion ]: " ver
413
401
version=${ver:- " $lastversion " } # if $ver ;then version=$ver;else version=$lastversion"
@@ -427,11 +415,6 @@ function main() {
427
415
if [ " $version " X = " $runversion " X ] && [ $_PLUGINS_CHANGE_ -eq 0 ]; then
428
416
# Do nothing
429
417
procssNotUpdate
430
- if [ " $_AUTO_UPDATE_ " X = " Y" X ]; then
431
- # Need set auto-update
432
- echo -e " ${YELLOW} Restarting auto-update..."
433
- startAutoUpdate
434
- fi
435
418
exit 0
436
419
fi
437
420
fi
@@ -488,12 +471,10 @@ function main() {
488
471
else
489
472
disableGateway
490
473
fi
491
-
474
+
492
475
startupNode
493
476
494
- if [ " $_AUTO_UPDATE_ " X == " Y" X ]; then
495
- startAutoUpdate
496
- fi
477
+ checkAndCleanAutoUpdate
497
478
}
498
479
499
480
main $@
0 commit comments