From 5eb0cc7d721851000ca1f1e72f6b6b0928e1b2a8 Mon Sep 17 00:00:00 2001 From: Eliezer Croitoru Date: Sun, 18 Jul 2021 23:45:03 +0300 Subject: [PATCH] 40 --- collect-clish-scripts.sh | 5 +++++ cron-example-with-diff-dstdom.sh | 11 ++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/collect-clish-scripts.sh b/collect-clish-scripts.sh index 272d38b..f10ff8d 100755 --- a/collect-clish-scripts.sh +++ b/collect-clish-scripts.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash +export CPDIR=/opt/fw1 +export FWDIR=${CPDIR} +export SUROOT=/var/suroot +. /pfrm2.0/etc/bashrc + if [ "$( pt users -f username $USER -F role | head -n 1 | grep -v {} )" != "ROLE.SUPER" ];then echo "This script can only run from a user with ROLE.SUPER ie super user" exit 1 diff --git a/cron-example-with-diff-dstdom.sh b/cron-example-with-diff-dstdom.sh index 55b9aac..347ddac 100755 --- a/cron-example-with-diff-dstdom.sh +++ b/cron-example-with-diff-dstdom.sh @@ -1,10 +1,5 @@ #!/usr/bin/env bash -if [ "$( pt users -f username $USER -F role | head -n 1 | grep -v {} )" != "ROLE.SUPER" ];then - echo "This script can only run from a user with ROLE.SUPER ie super user" - exit 1 -fi - FLAGS_PREFIX="/tmp/dst-dom-script-flag_" WORK_DIR="/tmp/dst-dom-script" @@ -16,6 +11,12 @@ export FWDIR=${CPDIR} export SUROOT=/var/suroot . /pfrm2.0/etc/bashrc +if [ "$( pt users -f username $USER -F role | head -n 1 | grep -v {} )" != "ROLE.SUPER" ];then + echo "This script can only run from a user with ROLE.SUPER ie super user" + exit 1 +fi + + if [ -f "${FLAGS_PREFIX}unsetx" ];then set -x fi