fix no new kerberos-ticket
This commit is contained in:
parent
1cdaa863ec
commit
dc631b7af1
1 changed files with 14 additions and 5 deletions
19
functions.sh
19
functions.sh
|
@ -198,7 +198,7 @@ mencfs () {
|
|||
logdebug "DESTDIR: $DESTDIR"
|
||||
[ -d "$DESTDIR" ] || mkdir -p "$DESTDIR"
|
||||
$PASS "${PKEY}" 1>/dev/null 2>&1 || { logerror "entry $PKEY does not exist in passwordsotre"; return 5; }
|
||||
local ENCFS_PASSWORD=$($PASS show "${PKEY}")
|
||||
local ENCFS_PASSWORD=$($PASS show "${PKEY}"|head -n1)
|
||||
|
||||
if [ -z ${ENCDIR+x} -a -d ${ENCDIR} ];then
|
||||
logerror "no encrypted directory found -> exit"
|
||||
|
@ -274,12 +274,15 @@ kinit-custom () {
|
|||
|
||||
[ -z ${PKEY+x} ] && return 3
|
||||
$PASS "${PKEY}" 1>/dev/null 2>&1 || return 3
|
||||
local KERBEROS_PASSWORD=$($PASS show "${PKEY}")
|
||||
local KERBEROS_USER=$($PASS "${PKEY}" | grep login | sed -e 's/^login: //' )
|
||||
#echo KERBEROS_PASSWORD: $KERBEROS_PASSWORD
|
||||
logtrace "PKEY: ${PKEY}"
|
||||
local KERBEROS_PASSWORD="$($PASS show "${PKEY}"|head -n1)"
|
||||
local KERBEROS_USER="$($PASS "${PKEY}" | grep login | sed -e 's/^login: //' )"
|
||||
logdebug "$($PASS "${PKEY}" | grep login | sed -e 's/^login: //')"
|
||||
logtrace "KERBEROS_PASSWORD: ${KERBEROS_PASSWORD}"
|
||||
logdebug "KERBEROS_USER: ${KERBEROS_USER}"
|
||||
loginfo "Get kerberos-ticket for: $KERBEROS_USER@$REALM"
|
||||
|
||||
if [ -z ${KERBEROS_USER+x} ];then
|
||||
if [ -z ${KERBEROS_USER:+x} ];then
|
||||
logwarn "no kerberos user found -> exit"
|
||||
EXIT
|
||||
return 4
|
||||
|
@ -1136,6 +1139,12 @@ function connectdb () {
|
|||
;;
|
||||
esac
|
||||
|
||||
cat << EOF
|
||||
connect to ${DB_HOST}:${DB_PORT}/${DB_NAME}
|
||||
with user: ${DB_USER}
|
||||
and passwd: ${DB_PWD}
|
||||
EOF
|
||||
|
||||
PGPASSWORD=$DB_PWD psql -h $DB_HOST -p $DB_PORT -U $DB_USER $DB_NAME
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue