From f62972b7617c6349f238f1420e7b7296065e866b Mon Sep 17 00:00:00 2001 From: Björn Jacke Date: Thu, 2 Dec 2010 10:34:34 +0100 Subject: s4/scripting/ktpass: make shell code portable and eliminate another bash requirement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Autobuild-User: Björn Jacke Autobuild-Date: Thu Dec 2 11:20:42 CET 2010 on sn-devel-104 --- source4/scripting/bin/ktpass.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/scripting/bin') diff --git a/source4/scripting/bin/ktpass.sh b/source4/scripting/bin/ktpass.sh index 74f740a8bb..e758eb3bfb 100755 --- a/source4/scripting/bin/ktpass.sh +++ b/source4/scripting/bin/ktpass.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # vim: expandtab # # Copyright (C) Matthieu Patou 2010 @@ -23,7 +23,7 @@ TEMP=`getopt -o h --long princ:,pass:,out:,host:,ptype:,enc:,path-to-ldbsearch: -n "$name" -- "$@"` eval set -- "$TEMP" -function usage { +usage () { echo -ne "$name --out --princ --pass |*\n" echo -ne " [--host hostname] [--enc ]\n" echo -ne " [--ptype ] [--path-to-ldbsearch ]\n" @@ -68,7 +68,7 @@ if [ -z $host ]; then fi kvno=`${path}ldbsearch -H ldap://$host "(|(samaccountname=$princ)(serviceprincipalname=$princ)(userprincipalname=$princ))" msds-keyversionnumber -k 1 -N 2>/dev/null| grep -i msds-keyversionnumber` -if [ "$kvno" == "" ]; then +if [ x"$kvno" = x"" ]; then echo -ne "Unable to find kvno for principal $princ\n" echo -ne " check that you are authentified with kerberos\n" exit 1 @@ -76,7 +76,7 @@ else kvno=`echo $kvno | sed 's/^.*: //'` fi -if [ "$pass" == "*" ]; then +if [ "$pass" = "*" ]; then echo -n "Enter password for $princ: " stty -echo read pass -- cgit