diff options
author | Yves Fischer <yvesf@cern.ch> | 2016-02-01 09:09:31 +0100 |
---|---|---|
committer | Yves Fischer <yvesf@cern.ch> | 2016-02-01 09:09:43 +0100 |
commit | 3cbe8700c8c6cb1ac41b506681234f995ca979ba (patch) | |
tree | 01b6f4e232e23ff9cf5379137a472796784d1abe /packages/cern-scripts/src/main/resources/bin/database-tunnels.sh | |
parent | 4de2d5afc7dfdb0409d2ac9359bbe5bac58e2edc (diff) | |
download | debian-packages-3cbe8700c8c6cb1ac41b506681234f995ca979ba.tar.gz debian-packages-3cbe8700c8c6cb1ac41b506681234f995ca979ba.zip |
cern-scripts: restructure source directory
Diffstat (limited to 'packages/cern-scripts/src/main/resources/bin/database-tunnels.sh')
-rwxr-xr-x | packages/cern-scripts/src/main/resources/bin/database-tunnels.sh | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/packages/cern-scripts/src/main/resources/bin/database-tunnels.sh b/packages/cern-scripts/src/main/resources/bin/database-tunnels.sh deleted file mode 100755 index 034ecf5..0000000 --- a/packages/cern-scripts/src/main/resources/bin/database-tunnels.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -REMOTE_UNC_PATH="//cerndfs.cern.ch/dfs/Applications/Oracle" -AISADM_IP=128.142.153.100 -AISADM_FINGERPRINT="`dirname \"$0\"`/../lib/aisadm-fingerprint" -SSH_USER=$USER -TNSNAMES="$HOME/.cache/tnsnames" -LOCAL=false -TEMP=`getopt -o phl: --long help,local,user: \ - -n '$0' -- "$@"` -if [ $? != 0 ] ; then echo "Failed to parse arguments..." >&2 ; exit 1 ; fi - -# Note the quotes around `$TEMP': they are essential! -eval set -- "$TEMP" - -function print() { echo -e "\e]0;$1\a"; echo "$1"; } - -while true ; do - case "$1" in - -p|--local) LOCAL=true ; shift ;; - -l|--user) shift; SSH_USER=$1; shift ;; - -h|--help) echo "$0 [--help|--local] [-l <name>|--user <name>]"; exit 0;; - --) shift ; break ;; - *) echo "Internal error! ($*)" ; exit 1 ;; - esac -done - -if ! $LOCAL; then - print "Mirror tnsnames.ore files to $TNSNAMES" && - mkdir -p "$TNSNAMES/admin" "$TNSNAMES/admin_localhost" && - smbclient -k "$REMOTE_UNC_PATH" -D ADMIN_localhost -TXc - 'ADMIN_localhost/OLD' | tar --strip-components=2 -x -C "$TNSNAMES/admin_localhost" && - smbclient -k "$REMOTE_UNC_PATH" -D ADMIN -TXc - 'ADMIN/OLD'| tar --strip-components=2 -x -C "$TNSNAMES/admin" || - echo "failed to mirror tnsnames to $TNSNAMES" >&2 -fi - -if $LOCAL; then - SSH_EXTRAOPTS="-oProxyCommand=ssh -l \"$SSH_USER\" lxplus.cern.ch nc $AISADM_IP 22" -else - true -fi - -print "Database Tunnel" && - ssh -l "$SSH_USER" \ - -L 10301:cman1.cern.ch:10300 -L 10302:cman2.cern.ch:10300 \ - -o UserKnownHostsFile=$AISADM_FINGERPRINT \ - ${SSH_EXTRAOPTS:+"$SSH_EXTRAOPTS"} \ - $AISADM_IP \ - "date; echo tunnel is running; cat" - |