mirror of
https://github.com/prurigro/buildhosts.git
synced 2024-11-21 13:52:31 -05:00
Clean up some syntax
This commit is contained in:
parent
b332639bc7
commit
fa33357b92
1 changed files with 3 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
#
|
#
|
||||||
# BuildHosts: Download & use custom hosts sources to build /etc/hosts
|
# 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
|
# Fail if the user isn't root when $HOSTS_DIR or isn't writable
|
||||||
if [[ ! -w "$HOSTS_DIR" ]]; then
|
if [[ ! -w "$HOSTS_DIR" ]]; then
|
||||||
buildhosts_rootcheck
|
buildhosts_rootcheck
|
||||||
elif [ -f "$HOSTS_SYSTEM" ] && [ ! -w "$HOSTS_SYSTEM" ]; then
|
elif [[ -f "$HOSTS_SYSTEM" && ! -w "$HOSTS_SYSTEM" ]]; then
|
||||||
buildhosts_rootcheck
|
buildhosts_rootcheck
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -106,7 +107,7 @@ function buildhosts_build {
|
||||||
|| buildhosts_error "$HOSTS_SOURCES doesn't contain any sources"
|
|| 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
|
# 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"
|
printf "$c_heading %s $c_reset %s\n" 'Moving:' "$HOSTS_SYSTEM to $HOSTS_CORE"
|
||||||
install -Dm644 "$HOSTS_SYSTEM" "$HOSTS_CORE"
|
install -Dm644 "$HOSTS_SYSTEM" "$HOSTS_CORE"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue