Changed all test command in kvmsetup.sh to use single brackets

This commit is contained in:
Graeme Christie 2014-05-28 01:28:04 +08:00
parent 165d69a1e7
commit 765c431f0e
1 changed files with 4 additions and 6 deletions

View File

@ -62,15 +62,13 @@ if [ -f "$HOME/.zshrc" ]; then
ZPROFILE="$HOME/.zshrc"
fi
echo ">>$ZPROFILE"
SOURCE_STR="[ -s \"$KRE_USER_HOME/kvm/kvm.sh\" ] && . \"$KRE_USER_HOME/kvm/kvm.sh\" # this loads kvm"
if [[ -z "$PROFILE" && -z "$ZPROFILE" ]] || [[ ! -f "$PROFILE" && ! -f "$ZPROFILE" ]] ; then
if [ -z "$PROFILE" && -z "$ZPROFILE" ] || [ ! -f "$PROFILE" && ! -f "$ZPROFILE" ] ; then
if [ -z "$PROFILE" ]; then
echo "=> Profile not found. Tried ~/.bash_profile ~/.zshrc and ~/.profile."
echo "=> Create one of them and run this script again"
elif [[ ! -f "$PROFILE" ]]; then
elif [ ! -f "$PROFILE" ]; then
echo "=> Profile $PROFILE not found"
echo "=> Create it (touch $PROFILE) and run this script again"
else
@ -83,8 +81,8 @@ if [[ -z "$PROFILE" && -z "$ZPROFILE" ]] || [[ ! -f "$PROFILE" && ! -f "$ZPROFIL
echo " $SOURCE_STR"
echo
else
[[ -n "$PROFILE" ]] && _kvmsetup_update_profile "$PROFILE" "$SOURCE_STR"
[[ -n "$ZPROFILE" ]] && _kvmsetup_update_profile "$ZPROFILE" "$SOURCE_STR"
[ -n "$PROFILE" ] && _kvmsetup_update_profile "$PROFILE" "$SOURCE_STR"
[ -n "$ZPROFILE" ] && _kvmsetup_update_profile "$ZPROFILE" "$SOURCE_STR"
fi
echo "=> Type 'source $KRE_USER_HOME/kvm/kvm.sh' to start using kvm"