From 673c8e696b7a6d741406fe8753cebc515e1cd8a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Juri=C5=A1i=C4=87?= Date: Fri, 8 Dec 2023 08:27:30 +0100 Subject: [PATCH] Added script for Postman --- devleops/postman/postman-install.sh | 56 +++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100755 devleops/postman/postman-install.sh diff --git a/devleops/postman/postman-install.sh b/devleops/postman/postman-install.sh new file mode 100755 index 0000000..ed9236c --- /dev/null +++ b/devleops/postman/postman-install.sh @@ -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 \ No newline at end of file