diff options
author | Björn Jacke <bj@sernet.de> | 2010-12-02 10:34:34 +0100 |
---|---|---|
committer | Bjoern Jacke <bj@sernet.de> | 2010-12-02 11:20:42 +0100 |
commit | f62972b7617c6349f238f1420e7b7296065e866b (patch) | |
tree | fe54217d0bd018099c1bc86deee039a2428a2dda /source4/scripting | |
parent | a42c731a4bff181f61e29cd16464ea240f76eeeb (diff) | |
download | samba-f62972b7617c6349f238f1420e7b7296065e866b.tar.gz samba-f62972b7617c6349f238f1420e7b7296065e866b.tar.bz2 samba-f62972b7617c6349f238f1420e7b7296065e866b.zip |
s4/scripting/ktpass: make shell code portable and eliminate another bash requirement
Autobuild-User: Björn Jacke <bj@sernet.de>
Autobuild-Date: Thu Dec 2 11:20:42 CET 2010 on sn-devel-104
Diffstat (limited to 'source4/scripting')
-rwxr-xr-x | source4/scripting/bin/ktpass.sh | 8 |
1 files changed, 4 insertions, 4 deletions
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 <mat@matws.net> 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 <keytabfile> --princ <principal> --pass <password>|*\n" echo -ne " [--host hostname] [--enc <encryption>]\n" echo -ne " [--ptype <type>] [--path-to-ldbsearch <path>]\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 |