Vonng / pigsty

Battery-Included PostgreSQL Distro as a Free RDS Alternative
https://pigsty.io
GNU Affero General Public License v3.0
3.01k stars 242 forks source link

Get shell script reports OK even when tar is missing #352

Closed jekader closed 7 months ago

jekader commented 7 months ago

Just ran the latest 2.5.1 get script on a new EL8 system missing tar and the bootstrap script happily reported success:

[Extracting] ===========================================
[ OK ] extract '/tmp/pigsty-v2.5.1.tgz' to '/root/pigsty'
[ OK ] $ tar -xf /tmp/pigsty-v2.5.1.tgz -C ~;
pigsty.sh: line 112: tar: command not found
[Reference] ===========================================
Official Site:   https://pigsty.cc
Get Started:     https://doc.pigsty.cc/#/INSTALL
Documentation:   https://doc.pigsty.cc
Github Repo:     https://github.com/Vonng/pigsty
Public Demo:     https://demo.pigsty.cc
[Proceeding] ===========================================
cd ~/pigsty      # entering pigsty home directory before proceeding
./bootstrap      # install ansible & download the optional offline packages
./configure      # preflight-check and generate config according to your env
./install.yml    # install pigsty on this node and init it as the admin node
[ OK ] ~/pigsty is ready to go now!

I propose adding a simple check that commands such as curl and tar are installed before proceeding with bootstrap.

if ! [ -x "$(command -v tar)" ]; then
  echo 'Error: tar is not installed.' >&2
  exit 1
fi
Vonng commented 7 months ago

Thanks for your feedback. I've added it to the check_repo section.

And use -L option for curl command. It will be released in the next release.

Vonng commented 7 months ago

resolved by https://github.com/Vonng/pigsty/commit/8498bb1aade4683d9fbb578d89747cfb88a80685