-
Notifications
You must be signed in to change notification settings - Fork 534
Hot fix for fixing bad genesis file on 2.1.5 install #1553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,27 +4,45 @@ set -e | |
|
|
||
| PKG_NAME=@PKG_NAME@ | ||
|
|
||
| if [ "$1" != install ] | ||
| if [ "$1" = install ] | ||
| then | ||
| exit 0 | ||
| if dpkg-query --list 'algorand*' &> /dev/null | ||
| then | ||
| if PKG_INFO=$(dpkg-query --show --showformat='${Package} ${Status}\n' 'algorand*' | grep "install ok installed") | ||
| then | ||
| # Filter out `algorand-indexer` and `algorand-devtools` packages, they are allowed to be | ||
| # installed alongside other `algorand` packages. | ||
| INSTALLED_PKG=$(grep -v -e algorand-indexer -e algorand-devtools <<< "$PKG_INFO" | awk '{print $1}') | ||
|
|
||
| if [ -n "$INSTALLED_PKG" ] | ||
| then | ||
| echo -e "\nAlgorand does not currently support multi-distribution installations!\n\ | ||
| To install this package, it is necessary to first remove the \`$INSTALLED_PKG\` package:\n\n\ | ||
| sudo apt-get remove $INSTALLED_PKG\n\ | ||
| sudo apt-get install $PKG_NAME\n" | ||
| exit 1 | ||
| fi | ||
| fi | ||
| fi | ||
| fi | ||
|
|
||
| if dpkg-query --list 'algorand*' &> /dev/null | ||
| if [ "$1" = upgrade ] | ||
| then | ||
| if PKG_INFO=$(dpkg-query --show --showformat='${Package} ${Status}\n' 'algorand*' | grep "install ok installed") | ||
| if [ -f /var/lib/algorand/genesis.json ] | ||
| then | ||
| # Filter out `algorand-indexer` and `algorand-devtools` packages, they are allowed to be | ||
| # installed alongside other `algorand` packages. | ||
| INSTALLED_PKG=$(grep -v -e algorand-indexer -e algorand-devtools <<< "$PKG_INFO" | awk '{print $1}') | ||
| ALGO_MD5=$(md5sum /var/lib/algorand/genesis.json | awk '{print $1}') | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since you're using pipes, consider using
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and then, use
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will fix. |
||
| ALGO_TIMESTAMP=$(stat -c %Y /var/lib/algorand/genesis.json) | ||
|
|
||
| if [ -n "$INSTALLED_PKG" ] | ||
| if [ "$ALGO_MD5" = "9afc34b96a2c4a9f936870cd26ae7873" ] | ||
| then | ||
| echo -e "\nAlgorand does not currently support multi-distribution installations!\n\ | ||
| To install this package, it is necessary to first remove the \`$INSTALLED_PKG\` package:\n\n\ | ||
| sudo apt-get remove $INSTALLED_PKG\n\ | ||
| sudo apt-get install $PKG_NAME\n" | ||
| exit 1 | ||
| if [[ "$ALGO_TIMESTAMP" != 1600456830 || | ||
| ( "$ALGO_TIMESTAMP" = 1600456830 && ! -d /var/lib/algorand/mainnet-v1.0 ) ]] | ||
| then | ||
| # 2.1.5 bug fix - back up user-modified genesis.json to restore after conffiles | ||
| cp -p /var/lib/algorand/genesis.json{,-2.1.5-patch} | ||
| fi | ||
| fi | ||
|
|
||
| fi | ||
| fi | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.