From 0c26203ff79b6ac19077f97370247e9896641739 Mon Sep 17 00:00:00 2001 From: 0xmachos <0xmachos@gmail.com> Date: Fri, 9 Mar 2018 13:39:12 +0000 Subject: [PATCH] Convert get user permission steps to function --- install | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/install b/install index 00a392f73..bd7cbe598 100755 --- a/install +++ b/install @@ -22,6 +22,16 @@ echo command_exists () { command -v "$1" /dev/null 2&>1 + + +get_permission () { + + warn 'This script will install BeEF and its required dependencies (including operating system packages).' + + read -rp "Are you sure you wish to continue (Y/n)? " + if [ "$(echo "${REPLY}" | tr "[:upper:]" "[:lower:]")" = "n" ] ; then + fatal 'Installation aborted' + fi } info() { echo "[INFO] $*"; } @@ -29,11 +39,6 @@ warn() { echo "[WARN] $*"; } error() { echo "[ERROR] $*"; } fatal() { echo "[FATAL] $*"; exit 1 ; } -warn 'This script will install BeEF and its required dependencies (including operating system packages).' -read -p "Are you sure you wish to continue (Y/n)? " -if [ "`echo ${REPLY} | tr [:upper:] [:lower:]`" = "n" ] ; then - fatal 'Installation aborted' -fi check_os () { info "Detecting OS..."