diff --git a/contrib/adc/able b/contrib/adc/able index a776a3a..1b73819 100755 --- a/contrib/adc/able +++ b/contrib/adc/able @@ -1,17 +1,17 @@ #!/bin/bash -# WARNING: USES BASH FEATURES... +# WARNING: USES BASH FEATURES TO AVOID A TEMP FILE; CAN BE FIXED IF NEEDED . $(dirname $0)/adc.common-functions get_rights_and_owner gitolite-admin -[[ -z $perm_write ]] && die "just *what* are you trying to pull, young man?" +[ -z "$perm_write" ] && die "just *what* are you trying to pull, young man?" op=$1 shift locs= -while [[ -n $1 ]] +while [ -n "$1" ] do case $1 in '@all' ) @@ -33,7 +33,7 @@ case $op in done ;; dis|disable ) - [[ -t 0 ]] && printf message: + # bashism read msg <<<$(cat) for l in $locs do diff --git a/contrib/adc/adc.common-functions b/contrib/adc/adc.common-functions index 2631ed2..0d2878c 100644 --- a/contrib/adc/adc.common-functions +++ b/contrib/adc/adc.common-functions @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # please make sure this file is NOT chmod +x @@ -11,7 +11,7 @@ get_rights_and_owner() { # set shell variables as needed owner=${ans#* } rights=${ans% *} - [[ $rights =~ C ]] && perm_create=yes || perm_create= - [[ $rights =~ R ]] && perm_read=yes || perm_read= - [[ $rights =~ W ]] && perm_write=yes || perm_write= + echo $rights | grep C >/dev/null 2>&1 && perm_create=yes || perm_create= + echo $rights | grep R >/dev/null 2>&1 && perm_read=yes || perm_read= + echo $rights | grep W >/dev/null 2>&1 && perm_write=yes || perm_write= } diff --git a/contrib/adc/fork b/contrib/adc/fork index 758675f..d5b065a 100755 --- a/contrib/adc/fork +++ b/contrib/adc/fork @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh from=$1 to=$2 @@ -10,10 +10,10 @@ to=$2 # have a new "git-init" command! get_rights_and_owner $from -[[ -z $perm_read ]] && die "no read permissions on $from" +[ -z "$perm_read" ] && die "no read permissions on $from" get_rights_and_owner $to -[[ -z $perm_create ]] && die "no create permissions on $to" +[ -z "$perm_create" ] && die "no create permissions on $to" # let gitolite create the repo first SSH_ORIGINAL_COMMAND="git-init '$to'" $GL_BINDIR/gl-auth-command $GL_USER diff --git a/contrib/adc/restrict-admin b/contrib/adc/restrict-admin index 97ad0d1..8d3d892 100755 --- a/contrib/adc/restrict-admin +++ b/contrib/adc/restrict-admin @@ -1,9 +1,9 @@ -#!/bin/bash +#!/bin/sh . $(dirname $0)/adc.common-functions get_rights_and_owner gitolite-admin -[[ -z $perm_write ]] && die "just *what* are you trying to pull, young man?" +[ -z "$perm_write" ] && die "just *what* are you trying to pull, young man?" # and here you let them do the dangerous stuff echo "+rm -rf $GL_REPO_BASE_ABS" diff --git a/contrib/adc/rmrepo b/contrib/adc/rmrepo index fa2554f..e1c288c 100755 --- a/contrib/adc/rmrepo +++ b/contrib/adc/rmrepo @@ -1,11 +1,11 @@ -#!/bin/bash +#!/bin/sh . $(dirname $0)/adc.common-functions delete=$1 get_rights_and_owner $delete -[[ $owner == $GL_USER ]] || die "$delete is not yours to delete!" +[ "$owner" = "$GL_USER" ] || die "$delete is not yours to delete!" cd $GL_REPO_BASE_ABS rm -rf $delete.git diff --git a/src/gl-emergency-addkey b/src/gl-emergency-addkey index d488798..f10027b 100755 --- a/src/gl-emergency-addkey +++ b/src/gl-emergency-addkey @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # what/why: re-establish gitolite admin access when admin key(s) lost # where: on server (NOT client!) @@ -20,7 +20,7 @@ # ENDHELP -[[ -z $1 ]] && { perl -pe "s(\\\$0)($0); last if /ENDHELP/" < $0; exit 1; } +[ -z "$1" ] && { perl -pe "s(\\\$0)($0); last if /ENDHELP/" < $0; exit 1; } set -e diff --git a/src/gl-system-install b/src/gl-system-install index b71cde9..5db21f3 100755 --- a/src/gl-system-install +++ b/src/gl-system-install @@ -39,7 +39,7 @@ if git rev-parse --is-inside-work-tree >/dev/null 2>&1 then git describe --tags --long HEAD 2>/dev/null > conf/VERSION || die "git describe failed -- this should not happen!" else - [[ -f conf/VERSION ]] || echo '(unknown)' > conf/VERSION + [ -f conf/VERSION ] || echo '(unknown)' > conf/VERSION fi cp -R conf/* $gl_conf_dir || die "cp conf/* to $gl_conf_dir failed"