mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 03:30:35 +00:00
prysm scripts should not save 404 pages (#9072)
* first .sh attempt, checked curl * removed echo * more meaningful msg * prysm.bat changes * do not save 404, using -f and grep * removed extra line Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
This commit is contained in:
parent
1d3a9983cc
commit
72886986ea
24
prysm.bat
24
prysm.bat
@ -67,10 +67,15 @@ if [%1]==[beacon-chain] (
|
||||
echo [32mBeacon chain is up to date.[0m
|
||||
) else (
|
||||
echo [35mDownloading beacon chain %prysm_version% to %BEACON_CHAIN_REAL% %reason%[0m
|
||||
curl -L https://prysmaticlabs.com/releases/beacon-chain-%prysm_version%-%system%-%arch% -o %BEACON_CHAIN_REAL%
|
||||
curl --silent -L https://prysmaticlabs.com/releases/beacon-chain-%prysm_version%-%system%-%arch%.sha256 -o %wrapper_dir%\beacon-chain-%prysm_version%-%system%-%arch%.sha256
|
||||
for /f "delims=" %%i in ('curl --silent -w "%%{http_code}" -L https://prysmaticlabs.com/releases/beacon-chain-%prysm_version%-%system%-%arch% -o %BEACON_CHAIN_REAL%') do set http=%%i
|
||||
if %http%==400 (
|
||||
echo [35mNo prysm beacon chain found for %prysm_version%[0m
|
||||
exit \b 1
|
||||
)
|
||||
curl --silent -L https://prysmaticlabs.com/releases/beacon-chain-%prysm_version%-%system%-%arch%.sha256 -o %wrapper_dir%\beacon-chain-%prysm_version%-%system%-%arch%.sha256
|
||||
curl --silent -L https://prysmaticlabs.com/releases/beacon-chain-%prysm_version%-%system%-%arch%.sig -o %wrapper_dir%\beacon-chain-%prysm_version%-%system%-%arch%.sig
|
||||
)
|
||||
goto startprocess
|
||||
)
|
||||
|
||||
if [%1]==[validator] (
|
||||
@ -78,10 +83,15 @@ if [%1]==[validator] (
|
||||
echo [32mValidator is up to date.[0m
|
||||
) else (
|
||||
echo [35mDownloading validator %prysm_version% to %VALIDATOR_REAL% %reason%[0m
|
||||
curl -L https://prysmaticlabs.com/releases/validator-%prysm_version%-%system%-%arch% -o %VALIDATOR_REAL%
|
||||
for /f "delims=" %%i in ('curl --silent -w "%%{http_code}" -L https://prysmaticlabs.com/releases/validator-%prysm_version%-%system%-%arch% -o %VALIDATOR_REAL%') do set http=%%i
|
||||
if %http%==400 (
|
||||
echo [35mNo prysm validator found for %prysm_version%[0m
|
||||
exit \b 1
|
||||
)
|
||||
curl --silent -L https://prysmaticlabs.com/releases/validator-%prysm_version%-%system%-%arch%.sha256 -o %wrapper_dir%\validator-%prysm_version%-%system%-%arch%.sha256
|
||||
curl --silent -L https://prysmaticlabs.com/releases/validator-%prysm_version%-%system%-%arch%.sig -o %wrapper_dir%\validator-%prysm_version%-%system%-%arch%.sig
|
||||
)
|
||||
goto startprocess
|
||||
)
|
||||
|
||||
if [%1]==[client-stats] (
|
||||
@ -89,10 +99,15 @@ if [%1]==[client-stats] (
|
||||
echo [32mClient-stats is up to date.[0m
|
||||
) else (
|
||||
echo [35mDownloading client-stats %prysm_version% to %CLIENT_STATS_REAL% %reason%[0m
|
||||
curl -L https://prysmaticlabs.com/releases/client-stats-%prysm_version%-%system%-%arch% -o %CLIENT_STATS_REAL%
|
||||
for /f "delims=" %%i in ('curl --silent -w "%%{http_code}" -L https://prysmaticlabs.com/releases/client-stats-%prysm_version%-%system%-%arch% -o %CLIENT_STATS_REAL%') do set http=%%i
|
||||
if %http%==400 (
|
||||
echo [35mNo prysm client stats found for %prysm_version%[0m
|
||||
exit \b 1
|
||||
)
|
||||
curl --silent -L https://prysmaticlabs.com/releases/client-stats-%prysm_version%-%system%-%arch%.sha256 -o %wrapper_dir%\client-stats-%prysm_version%-%system%-%arch%.sha256
|
||||
curl --silent -L https://prysmaticlabs.com/releases/client-stats-%prysm_version%-%system%-%arch%.sig -o %wrapper_dir%\client-stats-%prysm_version%-%system%-%arch%.sig
|
||||
)
|
||||
goto startprocess
|
||||
)
|
||||
|
||||
if [%1]==[slasher] (
|
||||
@ -100,6 +115,7 @@ if [%1]==[slasher] (
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
:startprocess
|
||||
if [%1]==[beacon-chain] ( set process=%BEACON_CHAIN_REAL%)
|
||||
if [%1]==[validator] ( set process=%VALIDATOR_REAL%)
|
||||
if [%1]==[client-stats] ( set process=%CLIENT_STATS_REAL%)
|
||||
|
18
prysm.sh
18
prysm.sh
@ -181,7 +181,11 @@ if [[ $1 == beacon-chain ]]; then
|
||||
if [[ ! -x $BEACON_CHAIN_REAL ]]; then
|
||||
color "34" "Downloading beacon chain@${prysm_version} to ${BEACON_CHAIN_REAL} (${reason})"
|
||||
file=beacon-chain-${prysm_version}-${system}-${arch}
|
||||
curl -L "https://prysmaticlabs.com/releases/${file}" -o "$BEACON_CHAIN_REAL"
|
||||
res=$(curl -w '%{http_code}\n' -f -L "https://prysmaticlabs.com/releases/${file}" -o "$BEACON_CHAIN_REAL" | ( grep 404 || true ) )
|
||||
if [[ $res == 404 ]];then
|
||||
echo "No prysm beacon chain found for ${prysm_version},(${file}) exit"
|
||||
exit 1
|
||||
fi
|
||||
curl --silent -L "https://prysmaticlabs.com/releases/${file}.sha256" -o "${wrapper_dir}/${file}.sha256"
|
||||
curl --silent -L "https://prysmaticlabs.com/releases/${file}.sig" -o "${wrapper_dir}/${file}.sig"
|
||||
chmod +x "$BEACON_CHAIN_REAL"
|
||||
@ -195,7 +199,11 @@ if [[ $1 == validator ]]; then
|
||||
color "34" "Downloading validator@${prysm_version} to ${VALIDATOR_REAL} (${reason})"
|
||||
|
||||
file=validator-${prysm_version}-${system}-${arch}
|
||||
curl -L "https://prysmaticlabs.com/releases/${file}" -o "$VALIDATOR_REAL"
|
||||
res=$(curl -w '%{http_code}\n' -f -L "https://prysmaticlabs.com/releases/${file}" -o "$VALIDATOR_REAL" | ( grep 404 || true ) )
|
||||
if [[ $res == 404 ]];then
|
||||
echo "No prysm validator found for ${prysm_version}, (${file}) exit"
|
||||
exit 1
|
||||
fi
|
||||
curl --silent -L "https://prysmaticlabs.com/releases/${file}.sha256" -o "${wrapper_dir}/${file}.sha256"
|
||||
curl --silent -L "https://prysmaticlabs.com/releases/${file}.sig" -o "${wrapper_dir}/${file}.sig"
|
||||
chmod +x "$VALIDATOR_REAL"
|
||||
@ -209,7 +217,11 @@ if [[ $1 == client-stats ]]; then
|
||||
color "34" "Downloading client-stats@${prysm_version} to ${CLIENT_STATS_REAL} (${reason})"
|
||||
|
||||
file=client-stats-${prysm_version}-${system}-${arch}
|
||||
curl -L "https://prysmaticlabs.com/releases/${file}" -o "$CLIENT_STATS_REAL"
|
||||
res=$(curl -w '%{http_code}\n' -f -L "https://prysmaticlabs.com/releases/${file}" -o "$CLIENT_STATS_REAL" | ( grep 404 || true ) )
|
||||
if [[ $res == 404 ]];then
|
||||
echo "No prysm client stats found for ${prysm_version},(${file}) exit"
|
||||
exit 1
|
||||
fi
|
||||
curl --silent -L "https://prysmaticlabs.com/releases/${file}.sha256" -o "${wrapper_dir}/${file}.sha256"
|
||||
curl --silent -L "https://prysmaticlabs.com/releases/${file}.sig" -o "${wrapper_dir}/${file}.sig"
|
||||
chmod +x "$CLIENT_STATS_REAL"
|
||||
|
Loading…
Reference in New Issue
Block a user