Linux sagir-us1.hostever.us 5.14.0-570.51.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 8 09:41:34 EDT 2025 x86_64
LiteSpeed
Server IP : 104.247.108.91 & Your IP : 216.73.216.222
Domains : 74 Domain
User : georgeto
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
local /
emps /
bin /
Delete
Unzip
Name
Size
Permission
Date
Action
annotate
13.09
KB
-rwxr-xr-x
2026-05-14 17:34
autoconf
14.32
KB
-rwxr-xr-x
2026-05-14 17:32
autoheader
8.43
KB
-rwxr-xr-x
2026-05-14 17:32
autom4te
31.48
KB
-rwxr-xr-x
2026-05-14 17:32
autopoint
23.93
KB
-rwxr-xr-x
2026-05-14 17:36
autoreconf
20.68
KB
-rwxr-xr-x
2026-05-14 17:32
autoscan
16.82
KB
-rwxr-xr-x
2026-05-14 17:32
autoupdate
33.17
KB
-rwxr-xr-x
2026-05-14 17:32
bdftogd
3.9
KB
-rwxr-xr-x
2026-05-14 17:34
bsqldb
41.8
KB
-rwxr-xr-x
2026-05-14 17:35
bunzip2
281.48
KB
-rwxr-xr-x
2026-05-14 17:33
bzcat
281.48
KB
-rwxr-xr-x
2026-05-14 17:33
bzcmp
2.08
KB
-rwxr-xr-x
2026-05-14 17:33
bzdiff
2.08
KB
-rwxr-xr-x
2026-05-14 17:33
bzegrep
1.64
KB
-rwxr-xr-x
2026-05-14 17:33
bzfgrep
1.64
KB
-rwxr-xr-x
2026-05-14 17:33
bzgrep
1.64
KB
-rwxr-xr-x
2026-05-14 17:33
bzip2
281.48
KB
-rwxr-xr-x
2026-05-14 17:33
bzip2recover
32.64
KB
-rwxr-xr-x
2026-05-14 17:33
bzless
1.23
KB
-rwxr-xr-x
2026-05-14 17:33
bzmore
1.23
KB
-rwxr-xr-x
2026-05-14 17:33
c_rehash
6.73
KB
-rwxr-xr-x
2026-05-14 17:16
captoinfo
63.13
KB
-rwxr-xr-x
2026-05-14 17:22
cjpeg
44.55
KB
-rwxr-xr-x
2026-05-14 17:34
clear
8.44
KB
-rwxr-xr-x
2026-05-14 17:22
clusterdb
81.73
KB
-rwxr-xr-x
2026-05-14 17:32
createdb
85.87
KB
-rwxr-xr-x
2026-05-14 17:32
createuser
82.13
KB
-rwxr-xr-x
2026-05-14 17:32
curl
242.66
KB
-rwxr-xr-x
2026-05-14 17:33
curl-config
5.67
KB
-rwxr-xr-x
2026-05-14 17:33
datacopy
27.1
KB
-rwxr-xr-x
2026-05-14 17:35
defncopy
28.15
KB
-rwxr-xr-x
2026-05-14 17:35
derb
30.97
KB
-rwxr-xr-x
2026-05-14 17:39
djpeg
35.84
KB
-rwxr-xr-x
2026-05-14 17:34
dropdb
77.02
KB
-rwxr-xr-x
2026-05-14 17:32
dropuser
76.96
KB
-rwxr-xr-x
2026-05-14 17:32
ecpg
981.44
KB
-rwxr-xr-x
2026-05-14 17:32
envsubst
43.15
KB
-rwxr-xr-x
2026-05-14 17:36
fisql
39.02
KB
-rwxr-xr-x
2026-05-14 17:35
fpmctl
1.73
KB
-rwxr-xr-x
2026-05-14 17:44
freebcp
27.42
KB
-rwxr-xr-x
2026-05-14 17:35
freetype-config
3.63
KB
-rwxr-xr-x
2026-05-14 17:34
gd2copypal
8.59
KB
-rwxr-xr-x
2026-05-14 17:34
gd2togif
8.54
KB
-rwxr-xr-x
2026-05-14 17:34
gd2topng
12.64
KB
-rwxr-xr-x
2026-05-14 17:34
gdcmpgif
12.63
KB
-rwxr-xr-x
2026-05-14 17:34
gdparttopng
8.64
KB
-rwxr-xr-x
2026-05-14 17:34
gdtopng
8.54
KB
-rwxr-xr-x
2026-05-14 17:34
genbrk
18.54
KB
-rwxr-xr-x
2026-05-14 17:39
gencfu
13.96
KB
-rwxr-xr-x
2026-05-14 17:39
gencnval
27.45
KB
-rwxr-xr-x
2026-05-14 17:39
gendict
29.29
KB
-rwxr-xr-x
2026-05-14 17:39
genrb
140.42
KB
-rwxr-xr-x
2026-05-14 17:39
gettext
42.57
KB
-rwxr-xr-x
2026-05-14 17:36
gettext.sh
4.51
KB
-rwxr-xr-x
2026-05-14 17:36
gettextize
41.16
KB
-rwxr-xr-x
2026-05-14 17:36
giftogd2
8.59
KB
-rwxr-xr-x
2026-05-14 17:34
iconv
109.52
KB
-rwxr-xr-x
2026-05-14 17:27
icu-config
21.54
KB
-rwxr-xr-x
2026-05-14 17:39
icuinfo
13.46
KB
-rwxr-xr-x
2026-05-14 17:39
ifnames
4.09
KB
-rwxr-xr-x
2026-05-14 17:32
infocmp
58.49
KB
-rwxr-xr-x
2026-05-14 17:22
infotocap
63.13
KB
-rwxr-xr-x
2026-05-14 17:22
initdb
144.46
KB
-rwxr-xr-x
2026-05-14 17:32
innochecksum
27.82
KB
-rwxr-xr-x
2026-05-14 17:26
jpegtran
52.73
KB
-rwxr-xr-x
2026-05-14 17:34
ldapadd
63.13
KB
-rwxr-xr-x
2026-05-14 17:29
ldapcompare
51.02
KB
-rwxr-xr-x
2026-05-14 17:29
ldapdelete
55.12
KB
-rwxr-xr-x
2026-05-14 17:29
ldapexop
51.09
KB
-rwxr-xr-x
2026-05-14 17:29
ldapmodify
63.13
KB
-rwxr-xr-x
2026-05-14 17:29
ldapmodrdn
51.02
KB
-rwxr-xr-x
2026-05-14 17:29
ldappasswd
51.04
KB
-rwxr-xr-x
2026-05-14 17:29
ldapsearch
75.3
KB
-rwxr-xr-x
2026-05-14 17:29
ldapurl
18.38
KB
-rwxr-xr-x
2026-05-14 17:29
ldapwhoami
51.04
KB
-rwxr-xr-x
2026-05-14 17:29
libmcrypt-config
1.43
KB
-rwxr-xr-x
2026-05-14 17:33
libpng-config
2.28
KB
-rwxr-xr-x
2026-05-14 17:34
libpng16-config
2.28
KB
-rwxr-xr-x
2026-05-14 17:34
libtool
311.68
KB
-rwxr-xr-x
2026-05-14 17:32
libtoolize
76.78
KB
-rwxr-xr-x
2026-05-14 17:32
makeconv
55.24
KB
-rwxr-xr-x
2026-05-14 17:39
mcrypt
110.92
KB
-rwxr-xr-x
2026-05-14 17:34
mdecrypt
110.92
KB
-rwxr-xr-x
2026-05-14 17:34
msgattrib
26.77
KB
-rwxr-xr-x
2026-05-14 17:36
msgcat
22.85
KB
-rwxr-xr-x
2026-05-14 17:36
msgcmp
28.12
KB
-rwxr-xr-x
2026-05-14 17:36
msgcomm
22.85
KB
-rwxr-xr-x
2026-05-14 17:36
msgconv
22.53
KB
-rwxr-xr-x
2026-05-14 17:36
msgen
22.52
KB
-rwxr-xr-x
2026-05-14 17:36
msgexec
18.8
KB
-rwxr-xr-x
2026-05-14 17:36
msgfilter
27.79
KB
-rwxr-xr-x
2026-05-14 17:36
msgfmt
91.11
KB
-rwxr-xr-x
2026-05-14 17:36
msggrep
45.83
KB
-rwxr-xr-x
2026-05-14 17:36
msginit
53.94
KB
-rwxr-xr-x
2026-05-14 17:36
msgmerge
69.17
KB
-rwxr-xr-x
2026-05-14 17:36
msgunfmt
37.17
KB
-rwxr-xr-x
2026-05-14 17:36
msguniq
22.73
KB
-rwxr-xr-x
2026-05-14 17:36
msql2mysql
1.42
KB
-rwxr-xr-x
2026-05-14 17:22
my_print_defaults
3.74
MB
-rwxr-xr-x
2026-05-14 17:26
myisam_ftdump
5.58
MB
-rwxr-xr-x
2026-05-14 17:23
myisamchk
6
MB
-rwxr-xr-x
2026-05-14 17:23
myisamlog
5.55
MB
-rwxr-xr-x
2026-05-14 17:23
myisampack
5.66
MB
-rwxr-xr-x
2026-05-14 17:23
mysql
7.9
MB
-rwxr-xr-x
2026-05-14 17:26
mysql_client_test
8
MB
-rwxr-xr-x
2026-05-14 17:26
mysql_config
6.66
KB
-rwxr-xr-x
2026-05-14 17:22
mysql_convert_table_format
4.11
KB
-rwxr-xr-x
2026-05-14 17:22
mysql_find_rows
3.21
KB
-rwxr-xr-x
2026-05-14 17:22
mysql_fix_extensions
1.22
KB
-rwxr-xr-x
2026-05-14 17:22
mysql_install_db
14.42
KB
-rwxr-xr-x
2026-05-14 17:22
mysql_plugin
3.78
MB
-rwxr-xr-x
2026-05-14 17:26
mysql_secure_installation
8.53
KB
-rwxr-xr-x
2026-05-14 17:22
mysql_setpermission
17.05
KB
-rwxr-xr-x
2026-05-14 17:22
mysql_tzinfo_to_sql
3.58
MB
-rwxr-xr-x
2026-05-14 17:26
mysql_upgrade
6.96
MB
-rwxr-xr-x
2026-05-14 17:26
mysql_waitpid
3.74
MB
-rwxr-xr-x
2026-05-14 17:26
mysql_zap
3.77
KB
-rwxr-xr-x
2026-05-14 17:22
mysqlaccess
109.38
KB
-rwxr-xr-x
2026-05-14 17:22
mysqlaccess.conf
1.66
KB
-rwxr-xr-x
2018-08-28 21:12
mysqladmin
6.9
MB
-rwxr-xr-x
2026-05-14 17:26
mysqlbinlog
7.54
MB
-rwxr-xr-x
2026-05-14 17:26
mysqlbug
10.43
KB
-rwxr-xr-x
2026-05-14 17:22
mysqlcheck
6.88
MB
-rwxr-xr-x
2026-05-14 17:26
mysqlctl
11.16
KB
-rwxr-xr-x
2026-05-14 17:36
mysqld
55.04
MB
-rwxr-xr-x
2026-05-14 17:26
mysqld_multi
23.55
KB
-rwxr-xr-x
2026-05-14 17:22
mysqld_safe
26.66
KB
-rwxr-xr-x
2026-05-14 17:22
mysqldump
7.1
MB
-rwxr-xr-x
2026-05-14 17:26
mysqldumpslow
7.19
KB
-rwxr-xr-x
2026-05-14 17:22
mysqlhotcopy
34.04
KB
-rwxr-xr-x
2026-05-14 17:22
mysqlimport
6.89
MB
-rwxr-xr-x
2026-05-14 17:26
mysqlshow
6.88
MB
-rwxr-xr-x
2026-05-14 17:26
mysqlslap
6.93
MB
-rwxr-xr-x
2026-05-14 17:26
mysqltest
7.52
MB
-rwxr-xr-x
2026-05-14 17:26
ncurses5-config
5.2
KB
-rwxr-xr-x
2026-05-14 17:22
ngettext
42.59
KB
-rwxr-xr-x
2026-05-14 17:36
nginxctl
2.23
KB
-rwxr-xr-x
2026-05-14 17:32
onig-config
1.35
KB
-rwxr-xr-x
2026-05-14 17:37
openssl
982.48
KB
-rwxr-xr-x
2026-05-14 17:18
osql
9.15
KB
-rwxr-xr-x
2026-05-14 17:35
pcre-config
2.31
KB
-rwxr-xr-x
2026-05-14 17:18
pcregrep
39.82
KB
-rwxr-xr-x
2026-05-14 17:18
pcretest
61.12
KB
-rwxr-xr-x
2026-05-14 17:18
perror
3.83
MB
-rwxr-xr-x
2026-05-14 17:26
pg_amcheck
108.26
KB
-rwxr-xr-x
2026-05-14 17:32
pg_archivecleanup
47.46
KB
-rwxr-xr-x
2026-05-14 17:32
pg_basebackup
137.1
KB
-rwxr-xr-x
2026-05-14 17:32
pg_checksums
65.62
KB
-rwxr-xr-x
2026-05-14 17:32
pg_config
45.98
KB
-rwxr-xr-x
2026-05-14 17:32
pg_controldata
60.11
KB
-rwxr-xr-x
2026-05-14 17:32
pg_ctl
75.36
KB
-rwxr-xr-x
2026-05-14 17:32
pg_dump
422.85
KB
-rwxr-xr-x
2026-05-14 17:32
pg_dumpall
116.84
KB
-rwxr-xr-x
2026-05-14 17:32
pg_isready
76.62
KB
-rwxr-xr-x
2026-05-14 17:32
pg_receivewal
96.14
KB
-rwxr-xr-x
2026-05-14 17:32
pg_recvlogical
96.74
KB
-rwxr-xr-x
2026-05-14 17:32
pg_resetwal
70.04
KB
-rwxr-xr-x
2026-05-14 17:32
pg_restore
192.88
KB
-rwxr-xr-x
2026-05-14 17:32
pg_rewind
144.02
KB
-rwxr-xr-x
2026-05-14 17:32
pg_test_fsync
48.18
KB
-rwxr-xr-x
2026-05-14 17:32
pg_test_timing
42.34
KB
-rwxr-xr-x
2026-05-14 17:32
pg_upgrade
158.74
KB
-rwxr-xr-x
2026-05-14 17:32
pg_verifybackup
116.66
KB
-rwxr-xr-x
2026-05-14 17:32
pg_waldump
106.17
KB
-rwxr-xr-x
2026-05-14 17:32
pgbench
193.3
KB
-rwxr-xr-x
2026-05-14 17:32
phar
14.54
KB
-rwxr-xr-x
2026-05-14 17:43
phar.phar
14.54
KB
-rwxr-xr-x
2026-05-14 17:43
php
19.99
MB
-rwxr-xr-x
2026-05-14 17:43
php-cgi
19.99
MB
-rwxr-xr-x
2026-05-14 17:43
php-config
5.14
KB
-rwxr-xr-x
2026-05-14 17:43
phpdbg
20.01
MB
-rwxr-xr-x
2026-05-14 17:43
phpize
4.43
KB
-rwxr-xr-x
2026-05-14 17:43
pkgdata
46.42
KB
-rwxr-xr-x
2026-05-14 17:39
pngtogd
8.54
KB
-rwxr-xr-x
2026-05-14 17:34
pngtogd2
8.59
KB
-rwxr-xr-x
2026-05-14 17:34
postgres
8.37
MB
-rwxr-xr-x
2026-05-14 17:32
postmaster
8.37
MB
-rwxr-xr-x
2026-05-14 17:32
psql
503.38
KB
-rwxr-xr-x
2026-05-14 17:32
rdjpgcom
13.3
KB
-rwxr-xr-x
2026-05-14 17:34
recode-sr-latin
18.17
KB
-rwxr-xr-x
2026-05-14 17:36
reindexdb
90.73
KB
-rwxr-xr-x
2026-05-14 17:32
replace
3.68
MB
-rwxr-xr-x
2026-05-14 17:26
reset
23.75
KB
-rwxr-xr-x
2026-05-14 17:22
resolve_stack_dump
3.75
MB
-rwxr-xr-x
2026-05-14 17:26
resolveip
3.74
MB
-rwxr-xr-x
2026-05-14 17:26
sqlite3
158.13
KB
-rwxr-xr-x
2026-05-14 17:33
tabs
17.53
KB
-rwxr-xr-x
2026-05-14 17:22
tdspool
405.46
KB
-rwxr-xr-x
2026-05-14 17:35
testgdbm
39.11
KB
-rwxr-xr-x
2026-05-14 17:34
tic
63.13
KB
-rwxr-xr-x
2026-05-14 17:22
toe
18.38
KB
-rwxr-xr-x
2026-05-14 17:22
tput
18.34
KB
-rwxr-xr-x
2026-05-14 17:22
tset
23.75
KB
-rwxr-xr-x
2026-05-14 17:22
tsql
381.83
KB
-rwxr-xr-x
2026-05-14 17:35
uconv
55.21
KB
-rwxr-xr-x
2026-05-14 17:39
vacuumdb
90.95
KB
-rwxr-xr-x
2026-05-14 17:32
webpng
17.77
KB
-rwxr-xr-x
2026-05-14 17:34
wrjpgcom
17.52
KB
-rwxr-xr-x
2026-05-14 17:34
xgettext
289.89
KB
-rwxr-xr-x
2026-05-14 17:36
xml2-config
1.77
KB
-rwxr-xr-x
2026-05-14 17:28
xmlcatalog
41.3
KB
-rwxr-xr-x
2026-05-14 17:28
xmllint
203.2
KB
-rwxr-xr-x
2026-05-14 17:28
xmlwf
33.66
KB
-rwxr-xr-x
2026-05-14 17:44
xslt-config
2.41
KB
-rwxr-xr-x
2026-05-14 17:28
xsltproc
81.52
KB
-rwxr-xr-x
2026-05-14 17:28
zipcmp
23.77
KB
-rwxr-xr-x
2026-05-14 17:37
zipmerge
14.38
KB
-rwxr-xr-x
2026-05-14 17:37
ziptool
48.5
KB
-rwxr-xr-x
2026-05-14 17:37
Save
Rename
#! /bin/sh # $Id: osql,v 1.12 2011-05-11 03:08:13 jklowden Exp $ # # Check odbc.ini, odbcinst, and, optionally, freetds.conf, # then execute isql (assume it's unixODBC's isql). # USAGE="Syntax: $(basename $0) -S server -U user -P password" while getopts I:S:U:P: OPTION do case ${OPTION} in I) OVER_DIR=${OPTARG} # override ;; S) DSN=${OPTARG} ;; U) USERNAME=${OPTARG} ;; P) PASSWORD=${OPTARG} ;; \?) echo $USAGE exit 1 ;; esac done #cho ${DSN} ${USERNAME} ${PASSWORD} if [ -z "${DSN}" -o -z "${USERNAME}" -o -z "${PASSWORD}" ] then echo $USAGE exit 1 fi ISQL=$(command -v isql) if [ -z "${ISQL}" ] then echo "$(basename $0): error: no \"isql\" command found. Is unixODBC installed?" exit 1 fi # Establish ODBC prefix directory ISQL_DIR=$(strings ${ISQL} | grep ^/ | grep -v elf | grep -v '\.so\.' | head -1 | sed 's/lib$/etc/' ) INI_DIRNAME="/tmp/$(basename $0).$$" exec 3> ${INI_DIRNAME} # Check the libraries, too. if [ -z "${OVER_DIR}" ] then echo "checking shared odbc libraries linked to isql for default directories..." (echo ${ISQL_DIR}; ldd "${ISQL}" | awk '/libodbc\./ {print $3}') \ | while read L do strings "$L" | grep '^/' | grep -v '/lib' \ | while read D do if [ ! -s "${INI_DIRNAME}" ] then printf " trying $D ... " if [ -d "$D" -a -r "${D}/odbc.ini" ] then printf $D >&3 printf "OK" else printf "no" fi printf "\n" fi done done fi ODBC_DIR=$(cat ${INI_DIRNAME}) && rm ${INI_DIRNAME} if [ -z "${ODBC_DIR}" -a -z "${OVER_DIR}" ] then echo "$(basename $0): problem: no potential directory strings in \"$(command -v isql)\"" echo "$(basename $0): advice: use \"osql -I DIR\" where DIR unixODBC\'s install prefix e.g. /usr/local" echo "isql strings are:" strings ${ISQL} | grep ^/ | sed 's/^/+ /' #xit 1 fi if [ "${OVER_DIR}" ] then if [ -d "${ODBC_DIR}" ] then echo "\"${ODBC_DIR}\" is a directory, overridden by" else echo "\"${ODBC_DIR}\" is NOT a directory, overridden by" fi echo "\"${OVER_DIR}\"." if [ -d "${OVER_DIR}" ] then ODBC_DIR=${OVER_DIR} else echo "$(basename $0): error: \"${OVER_DIR}\" is not a directory" exit 1 fi fi # Look for server entry in odbc.ini echo 'checking odbc.ini files' for F in "${HOME}/.odbc.ini" "${ODBC_DIR}/odbc.ini" do if [ ! -d "$(dirname $F)" ] then echo "warning: $(dirname $F) is not a directory" continue fi if [ -r "$F" ] then echo " reading $F" else echo " cannot read \"$F\"" continue fi grep -F "[${DSN}]" $F > /dev/null if [ $? -eq 0 ] then echo "[${DSN}] found in $F" ODBC_INI=$F break else echo "[${DSN}] not found in $F" fi done if [ -z "${ODBC_INI}" ] then echo "$(basename $0): error: unable to locate ${DSN} in any odbc.ini" exit 1 fi # Report finding of server entry echo found this section: SED_CMD="/^\[${DSN}\]/,/^[[:space:]]*$/ { s/^/ /; p; }" sed -ne "${SED_CMD}" ${ODBC_INI} # # Examine server entry in odbc.ini # # Find the driver in the servername or default section for D in "${DSN}" 'default' do echo "looking for driver for DSN [$D] in ${ODBC_INI}" grep "$D" ${ODBC_INI} > /dev/null if [ $? -eq 0 ] then CMD="/^\[$D\]/,/^[[:space:]]*$/ { s/^/ /; p; }" DRIVER_LINE=$(sed -ne "${CMD}" ${ODBC_INI} \ | grep -Ei '^[[:space:]]*driver[[:space:]]*=') if [ -z "${DRIVER_LINE}" ] then echo " no driver mentioned for [$D] in $(basename ${ODBC_INI})" continue fi echo " found driver line: \"${DRIVER_LINE}\"" DRIVER=$(echo ${DRIVER_LINE} \ | awk -F ' *= *' '{print $2}' \ | sed 's/[[:space:]][[:space:]]*//g') if [ "${DRIVER}" ] then echo " driver \"${DRIVER}\" found for [$D] in $(basename ${ODBC_INI})" break else echo " driver line for [$D] incomplete in $(basename ${ODBC_INI})" continue fi fi done if [ -z "${DRIVER}" ] then echo "$(basename $0): error: no driver found for [${DSN}] in $(basename ${ODBC_INI})" exit 1 fi # get filename of driver echo found driver named \"${DRIVER}\" if [ -d "${DRIVER}" -o ! -x "${DRIVER}" ] then # not a filename, look it up DRIVERNAME=${DRIVER} ODBC_INST="${ODBC_DIR}/odbcinst.ini" echo "\"${DRIVERNAME}\" is not an executable file" echo "looking for entry named [${DRIVERNAME}] in ${ODBC_INST}" grep "${DRIVERNAME}" ${ODBC_INST} > /dev/null if [ $? -ne 0 ] then if [ $? -eq 1 ] then echo "$(basename $0): error: no driver entry [${DRIVERNAME}] in ${ODBC_INST}" fi exit 1; fi CMD="/^\[${DRIVERNAME}\]/,/^[[:space:]]*$/ { s/^/ /; p; }" DRIVER_LINE=$(sed -ne "${CMD}" ${ODBC_INST} \ | grep -Ei '^[[:space:]]*driver[[:space:]]*=') if [ -z "${DRIVER_LINE}" ] then echo "$(basename $0): no driver mentioned for [${DRIVERNAME}] in $(basename ${ODBC_INST})" exit 1 fi echo " found driver line: \"${DRIVER_LINE}\"" DRIVER=$(echo ${DRIVER_LINE} | awk -F ' *= *' '{print $2}') if [ -z "${DRIVER}" ] then echo "$(basename $0): driver line incomplete for [${DRIVERNAME}] in $(basename ${ODBC_INST})" exit 1 fi echo " found driver ${DRIVER} for [${DRIVERNAME}] in $(basename ${ODBC_INST})" fi if [ -z "${DRIVER}" ] then echo $(basename $0): 'error: sorry, failed sanity check: ${DRIVER} is null' exit 1 fi if [ -x "${DRIVER}" ] then echo "${DRIVER} is an executable file" else echo "${DRIVER} is not an executable file" echo "$(basename $0): error: no driver found for ${DSN}" exit 1 fi # find the server/servername SERVER_LINE=$(sed -ne "${SED_CMD}" ${ODBC_INI} \ | grep -Ei '^[[:space:]]*server(name)*[[:space:]]*=') ATTRIBUTE=$(echo ${SERVER_LINE} | awk -F' *= *' '{print $1}') if [ -z "${ATTRIBUTE}" ] then echo "$(basename $0): neither \"Server\" nor \"Servername\" found for [${DSN}] in $(basename ${ODBC_INI})" exit 1 fi echo ${SERVER_LINE} | grep -i servername >/dev/null # # Find the server's hostname # if [ $? -eq 0 ] # ODBC-Combined then TDS_SERVER=$(echo ${SERVER_LINE} | awk -F ' *= *' '{print $2}') echo 'Using ODBC-Combined strategy' echo "DSN [${DSN}] has servername \"${TDS_SERVER}\" (from ${ODBC_INI})" if [ -z "${TDS_SERVER}" ] then exit 1 fi # Look for $TDS_SERVER in freetds.conf FREETDS_DIR=$(tsql -C | grep 'freetds.conf directory' | awk -F: '{print $2}' | sed 's/^ *//') if [ -z "${FREETDS_DIR}" ] then echo "$(basename $0): error: unable to locate directory for freetds.conf using \"$(command -v tsql)\"" exit 1 fi for F in "${HOME}/.freetds.conf" "${FREETDS_DIR}/freetds.conf" do if [ -r "$F" ] then echo $F is a readable file else echo cannot read \"$F\" continue fi echo "looking for [${TDS_SERVER}] in $F" grep -F "[${TDS_SERVER}]" $F > /dev/null if [ $? -eq 0 ] then FREETDS_CONF=$F break else echo "[${TDS_SERVER}]" not found in $F fi done if [ -z "${FREETDS_CONF}" ] then echo "$(basename $0): error: unable to locate ${TDS_SERVER} in any freetds.conf" exit 1 fi # Examine server entry in freetds.conf echo found this section: SED_CMD="/^\[${TDS_SERVER}\]/,/^[[:space:]]*$/ { s/^/ /; p; }" sed -ne "${SED_CMD}" ${FREETDS_CONF} SERVER_LINE=$(sed -ne "${SED_CMD}" ${FREETDS_CONF} \ | grep -Ei '^[[:space:]]*host[[:space:]]*=') # No character class support in mawk, # cf. "Mawk does not support Posix character classes in expressions" # https://bugs.launchpad.net/ubuntu/+source/mawk/+bug/69724 HOST=$(echo ${SERVER_LINE} | awk -F' *= *' '{print $2}') if [ -z "${HOST}" ] then echo "$(basename $0): no \"host\" entry found for [${TDS_SERVER}] in $(basename ${FREETDS_CONF})" exit 1 fi else # odbc.ini contains a "server", a DNS host HOST=$(echo ${SERVER_LINE} | awk -F ' *= *' '{print $2}') echo "\"${ATTRIBUTE}\" found, not using freetds.conf" echo "${ATTRIBUTE} is \"${HOST}\"" if [ -z "${HOST}" ] then echo "$(basename $0): no value found for \"${ATTRIBUTE}\" entry in $(basename ${ODBC_INI})" exit 1 fi fi # If the "host" is an ip address, look up the name, for neatness, e.g. ## $ host 10.81.36.39 ## 39.36.81.10.IN-ADDR.ARPA domain name pointer ntc5003.eg.com if [ "${HOST}" = "$(echo ${HOST} | sed 's/[^.0-9]*//')" ] then ADDRESS=${HOST} echo 'looking up hostname for ip address' ${ADDRESS} HOST=$(host ${HOST} | awk '/domain/ {print $5}' | sed 's/\.$//') if [ -z "${HOST}" ] then echo "$(basename $0): warning: no DNS hostname found for \"${ADDRESS}\"" HOST=${ADDRESS} # restore host address string fi fi # Now we have a DNS hostname for the server in HOST if [ "${HOST}" != "${ADDRESS}" ] then ADDRESS=$(host ${HOST} | awk '/has address/ {print $4}' | head -1) fi if [ -z "${ADDRESS}" ] then echo "$(basename $0): no IP address found for \"${HOST}\"" exit 1 fi #cho ${HOST} has address ${ADDRESS} # Report what we know and exec isql printf "\n" printf "Configuration looks OK. Connection details:\n\n" printf "%22s:\t%-30s\n" DSN ${DSN} printf "%22s:\t%-30s\n" odbc.ini "${ODBC_INI}" printf "%22s:\t%-30s\n" Driver ${DRIVER} printf "%22s:\t%-30s\n" "Server hostname" ${HOST} printf "%22s:\t%-30s\n" Address ${ADDRESS} printf "\n" echo Attempting connection as ${USERNAME} ... if [ -z "${TDSDUMP}" ] then TDSDUMP_AUTO="/tmp/$(basename $0).dump.$$" export TDSDUMP=${TDSDUMP_AUTO} fi ( set -x; isql ${DSN} ${USERNAME} ${PASSWORD} -v ) \ || sed -ne 's/Connecting/FAILED &/p' ${TDSDUMP} test "${TDSDUMP_AUTO}" && rm -f ${TDSDUMP_AUTO}