Skip to content

Commit

Permalink
updating script
Browse files Browse the repository at this point in the history
  • Loading branch information
ap0calypse644 committed Dec 20, 2024
1 parent 40cdc0d commit 2cc93ea
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion priv_gov_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
dir_name="private_gov_setup"
dir_path="$HOME/$dir_name"


# Check the Bash version
if [[ "${BASH_VERSINFO[0]}" -lt 4 ]]; then
echo "This script requires Bash version 4.0 or higher. You are using Bash ${BASH_VERSION}."
echo "Kindly update your bash and try again"
exit 1
fi

# Function to ask for user confirmation
ask_user() {
read -p "Directory $dir_path already exists. Do you want to continue? [y/N]: " decision
Expand Down Expand Up @@ -108,6 +116,7 @@ for repo_name in "${!git_repos[@]}"; do
install_cmd="${install_cmds[$repo_name]}"
if [[ -d "$repo_name" ]]; then
cd "$repo_name"
rm go.sum
go mod tidy || { echo "go mod tidy failed for $repo_name"; exit 1; }
cd ..
fi
Expand Down Expand Up @@ -192,7 +201,7 @@ make devnet-down
echo "Enter the new voting period (e.g., 2s, 30m, 240h):"
read new_voting_period

sed -i "/^\s*voting_period: .*/voting_period: ${new_voting_period}/" $dir_path/privgov/config.yml
sed -i'' -e '/^[[:space:]]*voting_period:/s/: .*/: '"${new_voting_period}"'/' "$dir_path/privgov/config.yml"

# Start fairyringd with logging
cd "$dir_path/fairyring"
Expand Down

0 comments on commit 2cc93ea

Please sign in to comment.