Added script for Postman
This commit is contained in:
parent
0f004122c6
commit
673c8e696b
56
devleops/postman/postman-install.sh
Executable file
56
devleops/postman/postman-install.sh
Executable file
@ -0,0 +1,56 @@
|
||||
#!/bin/bash
|
||||
|
||||
#### Variables
|
||||
APT_INST="apt -y install"
|
||||
DST_INST="/usr/local/share"
|
||||
DST_BIN="/usr/local/bin/postman"
|
||||
PKG_DEPS=(wget)
|
||||
URL_SRC="https://dl.pstmn.io/download/latest/linux_64"
|
||||
|
||||
#### Functions
|
||||
check_root() {
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo "Must be root to run $0"
|
||||
exit
|
||||
fi
|
||||
}
|
||||
|
||||
choice() {
|
||||
echo -ne "[y/n]"
|
||||
while true
|
||||
do
|
||||
read -rN1 input
|
||||
case $input in
|
||||
[yY][eE][sS]|[yY])
|
||||
return 0
|
||||
|
||||
break
|
||||
;;
|
||||
[nN][oO]|[nN])
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
|
||||
postman_install() {
|
||||
echo "* download postman"
|
||||
wget --quiet --show-progress "$URL_SRC" -O /tmp/postman-linux-x64.tar.gz
|
||||
|
||||
echo "* extract postman to $DST_INST"
|
||||
tar -xf /tmp/postman-linux-x64.tar.gz -C "$DST_INST"
|
||||
ln -f -s "$DST_INST/Postman/Postman" "$DST_BIN"
|
||||
cp postman.desktop /usr/share/applications
|
||||
|
||||
echo "* cleanup ..."
|
||||
rm -f /tmp/postman-linux-x64.tar.gz
|
||||
|
||||
echo "* installation of postman completed"
|
||||
}
|
||||
|
||||
#### Main
|
||||
|
||||
check_root
|
||||
postman_install
|
Loading…
x
Reference in New Issue
Block a user