From fa33357b9220c7af2ea910c328225192658f6264 Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Wed, 24 May 2017 10:33:22 -0400 Subject: [PATCH] Clean up some syntax --- buildhosts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/buildhosts b/buildhosts index 631e198..a9ef0ec 100755 --- a/buildhosts +++ b/buildhosts @@ -1,4 +1,5 @@ #!/usr/bin/env bash + # # BuildHosts: Download & use custom hosts sources to build /etc/hosts # @@ -84,7 +85,7 @@ function buildhosts_build { # Fail if the user isn't root when $HOSTS_DIR or isn't writable if [[ ! -w "$HOSTS_DIR" ]]; then buildhosts_rootcheck - elif [ -f "$HOSTS_SYSTEM" ] && [ ! -w "$HOSTS_SYSTEM" ]; then + elif [[ -f "$HOSTS_SYSTEM" && ! -w "$HOSTS_SYSTEM" ]]; then buildhosts_rootcheck fi @@ -106,7 +107,7 @@ function buildhosts_build { || buildhosts_error "$HOSTS_SOURCES doesn't contain any sources" # If $HOSTS_CORE doesn't exist and $HOSTS_SYSTEM does, move $HOSTS_SYSTEM to $HOSTS_CORE - [[ -f "$HOSTS_SYSTEM" ]] && [[ ! -f "$HOSTS_CORE" ]] && { + [[ -f "$HOSTS_SYSTEM" && ! -f "$HOSTS_CORE" ]] && { printf "$c_heading %s $c_reset %s\n" 'Moving:' "$HOSTS_SYSTEM to $HOSTS_CORE" install -Dm644 "$HOSTS_SYSTEM" "$HOSTS_CORE" }