Erreur32 zrewidował ten Gist 6 months ago. Przejdź do rewizji
Brak zmian
Erreur32 zrewidował ten Gist 7 years ago. Przejdź do rewizji
1 file changed, 7 insertions, 7 deletions
updater-netdata.sh
| @@ -1,11 +1,13 @@ | |||
| 1 | - | ||
| 2 | 1 | #!/bin/bash | |
| 3 | 2 | # | |
| 4 | 3 | # Script Updater for netdata | |
| 5 | 4 | # | |
| 6 | - | # - Dependencies: Wring package (NPM) | |
| 5 | + | # /!\ NEED Depencies: | |
| 6 | + | # Wring package (NPM) | |
| 7 | + | # Install: | |
| 8 | + | # npm install --global wring | |
| 7 | 9 | # | |
| 8 | - | # By Erreur32 - 2018 | |
| 10 | + | # By Erreur32 - 2018 December | |
| 9 | 11 | # | |
| 10 | 12 | ||
| 11 | 13 | ||
| @@ -37,7 +39,7 @@ if [ -f "/usr/bin/wring" ] || [ -f "/usr/local/bin/wring" ] | |||
| 37 | 39 | ||
| 38 | 40 | # need to check in other way... /usr/sbin/netdata -V | cut -c"9-" | cut -c "1-6" | |
| 39 | 41 | VersionInstalled="$(/usr/sbin/netdata -v | cut -c"9-" | cut -c "1-6")" | |
| 40 | - | VersionAvailable="$(curl -s $releasehub | wring text - '.css-truncate-target' | sed -n 5p)" | |
| 42 | + | VersionAvailable="$(curl -s $releasehub | wring text - '.muted-link' |sed -n 8p)" | |
| 41 | 43 | ||
| 42 | 44 | echo -e "$ROSE Checking $service version ... " | |
| 43 | 45 | echo -e "$JAUNE Version installed = v$VersionInstalled" | |
| @@ -47,9 +49,7 @@ echo "" | |||
| 47 | 49 | ||
| 48 | 50 | if [ -z "$VersionInstalled" ] | |
| 49 | 51 | then | |
| 50 | - | echo -e "$service is not installed " | |
| 51 | - | echo -e "To install it, type: $JAUNE wget https://my-netdata.io/kickstart.sh -O /opt/netdata-last-installer.sh $NC && /opt/netdata-last-installer.sh " | |
| 52 | - | echo -e "- exit -" | |
| 52 | + | echo -e "$service is not installed - exit " | |
| 53 | 53 | exit | |
| 54 | 54 | fi | |
| 55 | 55 | ||
Erreur32 zrewidował ten Gist 7 years ago. Przejdź do rewizji
1 file changed, 1 insertion, 1 deletion
updater-netdata.sh
| @@ -48,7 +48,7 @@ echo "" | |||
| 48 | 48 | if [ -z "$VersionInstalled" ] | |
| 49 | 49 | then | |
| 50 | 50 | echo -e "$service is not installed " | |
| 51 | - | echo -e "To install it, type: $JAUNE wget https://my-netdata.io/kickstart.sh -O /opt/netdata-last-installer.sh $NC" | |
| 51 | + | echo -e "To install it, type: $JAUNE wget https://my-netdata.io/kickstart.sh -O /opt/netdata-last-installer.sh $NC && /opt/netdata-last-installer.sh " | |
| 52 | 52 | echo -e "- exit -" | |
| 53 | 53 | exit | |
| 54 | 54 | fi | |
Erreur32 zrewidował ten Gist 7 years ago. Przejdź do rewizji
1 file changed, 3 insertions, 1 deletion
updater-netdata.sh
| @@ -47,7 +47,9 @@ echo "" | |||
| 47 | 47 | ||
| 48 | 48 | if [ -z "$VersionInstalled" ] | |
| 49 | 49 | then | |
| 50 | - | echo -e "$service is not installed - exit " | |
| 50 | + | echo -e "$service is not installed " | |
| 51 | + | echo -e "To install it, type: $JAUNE wget https://my-netdata.io/kickstart.sh -O /opt/netdata-last-installer.sh $NC" | |
| 52 | + | echo -e "- exit -" | |
| 51 | 53 | exit | |
| 52 | 54 | fi | |
| 53 | 55 | ||
Erreur32 zrewidował ten Gist 7 years ago. Przejdź do rewizji
1 file changed, 1 insertion, 1 deletion
updater-netdata.sh
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | # | |
| 4 | 4 | # Script Updater for netdata | |
| 5 | 5 | # | |
| 6 | - | # - Depencies: Wring package (NPM) | |
| 6 | + | # - Dependencies: Wring package (NPM) | |
| 7 | 7 | # | |
| 8 | 8 | # By Erreur32 - 2018 | |
| 9 | 9 | # | |
Erreur32 zrewidował ten Gist 7 years ago. Przejdź do rewizji
1 file changed, 72 insertions, 9 deletions
updater-netdata.sh
| @@ -1,13 +1,76 @@ | |||
| 1 | + | ||
| 1 | 2 | #!/bin/bash | |
| 2 | - | # Script Update Netdata auto | |
| 3 | - | # Should be add with a cron | |
| 4 | - | # * * 1 * * /path/updater-netdata.sh | |
| 3 | + | # | |
| 4 | + | # Script Updater for netdata | |
| 5 | + | # | |
| 6 | + | # - Depencies: Wring package (NPM) | |
| 7 | + | # | |
| 8 | + | # By Erreur32 - 2018 | |
| 9 | + | # | |
| 10 | + | ||
| 11 | + | ||
| 12 | + | service=netdata | |
| 13 | + | releasehub=https://github.com/netdata/netdata/releases | |
| 14 | + | ||
| 15 | + | VERT="\\033[1;32m" | |
| 16 | + | NORMAL="\\033[0;39m" | |
| 17 | + | ROUGE="\\033[1;31m" | |
| 18 | + | ROSE="\\033[1;35m" | |
| 19 | + | BLEU="\\033[1;34m" | |
| 20 | + | BLANC="\\033[0;02m" | |
| 21 | + | BLANCLAIR="\\033[1;08m" | |
| 22 | + | JAUNE="\\033[1;33m" | |
| 23 | + | CYAN="\\033[1;36m" | |
| 24 | + | NOC=$(tput sgr0) | |
| 25 | + | NC=$(tput sgr0) | |
| 26 | + | ||
| 27 | + | ||
| 28 | + | ## Check if wring is installed | |
| 29 | + | if [ -f "/usr/bin/wring" ] || [ -f "/usr/local/bin/wring" ] | |
| 30 | + | then | |
| 31 | + | echo -e "\n\e[34m - Wring package \e[0m>> founded.\e[0m\n" | |
| 32 | + | else | |
| 33 | + | echo -e "\n\e[92m - Install Wring with NPM \e[0m\n" | |
| 34 | + | npm install --global wring && echo "Success install Wring" || echo "failure to install Wring" | |
| 35 | + | echo -e "\n\e[34m - .\e[0m\n" | |
| 36 | + | fi | |
| 37 | + | ||
| 38 | + | # need to check in other way... /usr/sbin/netdata -V | cut -c"9-" | cut -c "1-6" | |
| 39 | + | VersionInstalled="$(/usr/sbin/netdata -v | cut -c"9-" | cut -c "1-6")" | |
| 40 | + | VersionAvailable="$(curl -s $releasehub | wring text - '.css-truncate-target' | sed -n 5p)" | |
| 41 | + | ||
| 42 | + | echo -e "$ROSE Checking $service version ... " | |
| 43 | + | echo -e "$JAUNE Version installed = v$VersionInstalled" | |
| 44 | + | echo -e "$JAUNE Version Available = $VersionAvailable" | |
| 45 | + | echo "" | |
| 46 | + | ||
| 47 | + | ||
| 48 | + | if [ -z "$VersionInstalled" ] | |
| 49 | + | then | |
| 50 | + | echo -e "$service is not installed - exit " | |
| 51 | + | exit | |
| 52 | + | fi | |
| 5 | 53 | ||
| 6 | - | echo -e "Start Updating Netdata" | |
| 54 | + | if [[ "$VersionAvailable" = "v$VersionInstalled" ]] | |
| 55 | + | then | |
| 56 | + | echo -e "$service is already up-to-date (version $VersionInstalled) ... Bye! " | |
| 57 | + | exit | |
| 58 | + | fi | |
| 7 | 59 | ||
| 8 | - | rm /opt/netdata-last-installer.sh -f | |
| 9 | - | wget https://my-netdata.io/kickstart.sh -O /opt/netdata-last-installer.sh | |
| 10 | - | chmod +x /opt/netdata-last-installer.sh | |
| 11 | 60 | ||
| 12 | - | bash /opt/netdata-last-installer.sh | |
| 13 | - | echo -e "Updating Netdata finishing!" | |
| 61 | + | echo -e "$VERT Start install New Updater from Netdata $NC" | |
| 62 | + | if [ -f "/opt/netdata-last-installer.sh" ] | |
| 63 | + | then | |
| 64 | + | rm /opt/netdata-last-installer.sh -f | |
| 65 | + | wget https://my-netdata.io/kickstart.sh -O /opt/netdata-last-installer.sh --no-verbose && echo -e "$CYAN Get success last installer " || echo "failure" | |
| 66 | + | chmod +x /opt/netdata-last-installer.sh | |
| 67 | + | else | |
| 68 | + | wget https://my-netdata.io/kickstart.sh -O /opt/netdata-last-installer.sh --no-verbose && echo -e "$CYAN Get success last installer " || echo "failure" | |
| 69 | + | chmod +x /opt/netdata-last-installer.sh | |
| 70 | + | fi | |
| 71 | + | echo -e " $NC" | |
| 72 | + | echo -e "$JAUNE Start Updating Netdata..." | |
| 73 | + | /bin/bash /opt/netdata-last-installer.sh && echo -e " Updating Netdata Successfully!" || echo "failure" | |
| 74 | + | echo "" | |
| 75 | + | echo -e " $VERT Update ✔ Netdata..." | |
| 76 | + | echo -e " $NC" | |
Erreur32 zrewidował ten Gist 7 years ago. Przejdź do rewizji
1 file changed, 3 insertions, 1 deletion
gistfile1.txt zmieniono nazwę na updater-netdata.sh
| @@ -1,5 +1,7 @@ | |||
| 1 | - | cat /home/tools/SH/updater-netdata.sh | |
| 2 | 1 | #!/bin/bash | |
| 2 | + | # Script Update Netdata auto | |
| 3 | + | # Should be add with a cron | |
| 4 | + | # * * 1 * * /path/updater-netdata.sh | |
| 3 | 5 | ||
| 4 | 6 | echo -e "Start Updating Netdata" | |
| 5 | 7 | ||
Erreur32 zrewidował ten Gist 7 years ago. Przejdź do rewizji
1 file changed, 11 insertions
gistfile1.txt(stworzono plik)
| @@ -0,0 +1,11 @@ | |||
| 1 | + | cat /home/tools/SH/updater-netdata.sh | |
| 2 | + | #!/bin/bash | |
| 3 | + | ||
| 4 | + | echo -e "Start Updating Netdata" | |
| 5 | + | ||
| 6 | + | rm /opt/netdata-last-installer.sh -f | |
| 7 | + | wget https://my-netdata.io/kickstart.sh -O /opt/netdata-last-installer.sh | |
| 8 | + | chmod +x /opt/netdata-last-installer.sh | |
| 9 | + | ||
| 10 | + | bash /opt/netdata-last-installer.sh | |
| 11 | + | echo -e "Updating Netdata finishing!" | |