Sponsored Content
Top Forums Shell Programming and Scripting Check the connectivity of the DB through script, exit if no connection Post 302724765 by Yoda on Thursday 1st of November 2012 09:21:31 AM
Old 11-01-2012
You can use below code to test connectivity:-

Code:
Out=`sqlplus -s ${USERNAME}/${PASSWORD}@${DB} << EOF
set echo off head off feed off pagesize 0 trimspool on linesize 1000
select 'OK' from dual;
exit;
EOF`

if [ "$Out" = "OK" ]
then
        echo "Connectivity OK"
else
        echo "Connectivity FAILED"
fi

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to check exit status in awk script

Hi, I have a main program which have below lines - awk -f test.awk inputFileName - I wonder how to check status return from awk script. content of awk script: test.awk --- if ( pass validation ) { exit 1 } else { (1 Reply)
Discussion started by: epall
1 Replies

2. Shell Programming and Scripting

check exit status - Expect Script

from my main script, i am calling an expect script. there are a lot of conditions in the Expect script and it can have any exit value based on success or failure of the Expect Script. how can i check the exit status of Expect scritp in the main script. (1 Reply)
Discussion started by: iamcool
1 Replies

3. Shell Programming and Scripting

Script to check connectivity

I want to write a script to check if a unix box say abc.tdc.cin.net can be connected or not on certain port say 22. right know i have to telnet them manually from DOS prompt and if it is successful then isay it is connected. Also to check Database connectivity I am using tnsping From DOS prompt.... (3 Replies)
Discussion started by: kukretiabhi13
3 Replies

4. Shell Programming and Scripting

Linux: Writing a tricky script to check connectivity

So, first and foremost, I'm having issues with my internet connection. Periodically, the connection drops across the network. The fix is simple enough: restart the modem. However, this gets old when the connection dies out every hour. I can hit my surfboard on 192.168.100.1, and navigate to a... (5 Replies)
Discussion started by: kungfujoe
5 Replies

5. Shell Programming and Scripting

Check file and if it doesnt exist , exit script

Hi, Another problem, here is my code #!/bin/sh dir='/opt/apps/script/CSV' datadir='/opt/apps/script/data' while : ; do ls -1rt $dir/*.csv > /dev/null 2>&1 if ;then cp $datadir/weekly.txt $dir/weekly.csv else exit 0 fi done (10 Replies)
Discussion started by: tententen
10 Replies

6. Shell Programming and Scripting

Check connectivity script

This past weekend I had some issues with my ISP. So for future purpose I'm going to have some logging on my internet so I'm able to attach log files to my complaint email if this issue reoccurs. Decided to do a simple ping script that runs every 5 or 10 min with crontab if ping fail write date... (5 Replies)
Discussion started by: chipmunken
5 Replies

7. Solaris

Sybase Connectivity Check through Shell Script

Hi, I need to check the sysbase database connectivity through the Unix Shell Script. Can you help me on the how to write the script to test the sysbase database connection. Thanks in Advance Nandha (0 Replies)
Discussion started by: nandha2387
0 Replies

8. Shell Programming and Scripting

Help with shell script to check the tcp network connectivity between server

Hello, I have a requirement to check the tcp network connectivity between server it's running on and the list of host's and ports combination. i have written the below code but it doesn't work, but when i execute the nc command outside the script it works fine. please help me where i am... (8 Replies)
Discussion started by: sknovice
8 Replies

9. Shell Programming and Scripting

Check connectivity with multiple hosts - BASH script available here

Hi everyone! Some time ago, I had to check connectivity with a big list of hosts, using different formats (protocol://server:port/path/, server:port, ....). I developed a script that checks the connectivity using different commands (ping, telnet, nc, curl). It worked for me so I'm sharing it... (9 Replies)
Discussion started by: Fr3dY
9 Replies

10. Shell Programming and Scripting

Need Script to check the FTP connection

Hi, I need a script which check the FTP connections, if its working fine then no issue. Incase not working fine then Trigger the mail. Please help on this. Thanks (4 Replies)
Discussion started by: Keshav Kalra
4 Replies
Authen::DecHpwd(3pm)					User Contributed Perl Documentation				      Authen::DecHpwd(3pm)

NAME
Authen::DecHpwd - DEC VMS password hashing SYNOPSIS
use Authen::DecHpwd qw( UAI_C_AD_II UAI_C_PURDY UAI_C_PURDY_V UAI_C_PURDY_S lgi_hpwd ); $hash = lgi_hpwd("JRANDOM", "PASSWORD", UAI_C_PURDY_S, 1234); use Authen::DecHpwd qw(vms_username vms_password); $username = vms_username($username); $password = vms_password($password); DESCRIPTION
This module implements the "SYS$HASH_PASSWORD" password hashing function from VMS (also known as "LGI$HPWD"), and some associated VMS username and password handling functions. The password hashing function is implemented in XS, with a hideously slow pure Perl backup version for systems that can't handle XS. FUNCTIONS
UAI_C_AD_II UAI_C_PURDY UAI_C_PURDY_V UAI_C_PURDY_S These constants are used to identify the four password hashing algorithms used by VMS. They are the "UAI$C_" constants in VMS. "UAI_C_AD_II" refers to a 32-bit CRC algorithm. The CRC polynomial used is the IEEE CRC-32 polynomial, as used in Ethernet, and in this context is known as "AUTODIN-II". The hash is merely the CRC of the password. "UAI_C_PURDY", "UAI_C_PURDY_V", and "UAI_C_PURDY_S" refer to successive refinements of an algorithm based on Purdy polynomials. All of these algorithms use the salt and username parameters as salt, use the whole password, and return an eight-byte (64-bit) hash. The main part of the algorithm, the Purdy polynomial, is identical in all three. They differ in the pre-hashing, particularly in the treatment of the username parameter. In "UAI_C_PURDY" the username is truncated or space-padded to 12 characters before being hashed in. "UAI_C_PURDY_V" accepts a variable-length username. "UAI_C_PURDY_S" accepts a variable-length username and also includes the password length in the hash. "UAI_C_PURDY_S" also does some extra bit rotations when hashing in the username and password strings, in order to avoid aliasing. lgi_hpwd(USERNAME, PASSWORD, ALGORITHM, SALT) This is the "SYS$HASH_PASSWORD" function from VMS (also known as "LGI$HPWD"), but with the parameters in a different order. It hashes the PASSWORD string in a manner determined by the other parameters, and returns the hash as a string of bytes. ALGORITHM determines which hashing algorithm will be used. It must be the value of one of the algorithm constants supplied by this module (see above). SALT must be an integer in the range [0, 2^16). It modifies the hashing so that the same password does not always produce the same hash. USERNAME is a string that is used as more salt. In VMS it is the username of the account to which the password controls access. VMS usernames and passwords are constrained in character set and length, and are case-insensitive. This function does not enforce these restrictions, nor perform canonicalisation. If restrictions and canonicalisation are desired then they must be applied separately. The functions "vms_username" and "vms_password" described below may be useful. vms_username(USERNAME) Checks whether the USERNAME string matches VMS username syntax, and canonicalises it. VMS username syntax is 1 to 31 characters from case-insensitive alphanumerics, "_", and "$". If the string has correct username syntax then the username is returned in canonical form (uppercase). If the string is not a username then "undef" is returned. vms_password(PASSWORD) Checks whether the PASSWORD string is an acceptable VMS password, and canonicalises it. VMS password syntax is 1 to 32 characters from case-insensitive alphanumerics, "_", and "$". If the string is an acceptable password then the password is returned in canonical form (uppercase). If the string is not an acceptable password then "undef" is returned. SEE ALSO
VMS::User AUTHOR
The original C implementation of "LGI$HPWD" was written by Shawn Clifford. The code has since been developed by Davide Casale, Mario Ambrogetti, Terence Lee, Jean-loup Gailly, Solar Designer, and Andrew Main (Zefram). Mike McCauley <mikem@open.com.au> created the first version of "Authen::DecHpwd", establishing the Perl interface. This was based on Shawn Clifford's code without the later developments. Andrew Main (Zefram) <zefram@fysh.org> created a new "Authen::DecHpwd" based on the more developed C code presently used, and added ancillary functions. COPYRIGHT
Copyright (C) 2002 Jean-loup Gailly <http://gailly.net> Based in part on code from John the Ripper, Copyright (C) 1996-2002 Solar Designer Copyright (C) 2006, 2007, 2009, 2010, 2011 Andrew Main (Zefram) <zefram@fysh.org> LICENSE
This module is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. perl v5.14.2 2011-11-15 Authen::DecHpwd(3pm)
All times are GMT -4. The time now is 10:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy