Created
July 16, 2024 19:45
-
-
Save BuddhiLW/dc1ec677b9909da40c58413587bf3efc to your computer and use it in GitHub Desktop.
Install Postman
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Download and extract the file, and capture the output of tar | |
output=$(wget -qO- https://dl.pstmn.io/download/latest/linux_64 | tar xzvf - 2>&1) | |
status=$? | |
# Check if the command was successful | |
if [ $status -eq 0 ]; then | |
echo "Download and extraction successful." | |
echo "$output" # Print the captured output if needed | |
# Take further action here | |
sudo mv Postman /opt/ | |
sudo ln -sf /opt/Postman/Postman /bin/postman | |
echo "Postman has been moved to /opt/" | |
echo "use command 'postman', in order to lauch Postman." | |
else | |
echo "Download or extraction failed." | |
echo "$output" # Print the captured output to see what went wrong | |
# Handle the error here | |
exit 1 | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment