From 6edb063b2b0328d577d685258979b2e8d153752c Mon Sep 17 00:00:00 2001 From: sparklyballs Date: Fri, 16 Oct 2015 16:20:20 +0100 Subject: [PATCH] change config init from if block to [[]] style test --- init/40_set_config.sh | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/init/40_set_config.sh b/init/40_set_config.sh index 9b17a87..087126f 100644 --- a/init/40_set_config.sh +++ b/init/40_set_config.sh @@ -1,22 +1,7 @@ #!/bin/bash -# Check if beets.sh exists. If not, copy in -if [ -f /config/beets.sh ]; then - echo "Using existing config file." -else - echo "Creating beets.sh from template." - cp -v /defaults/beets.sh /config/beets.sh - chown abc:abc /config/beets.sh - chmod +x /config/beets.sh -fi +[[ ! -f /config/beets.sh ]] && cp /defaults/beets.sh /config/beets.sh +[[ ! -f /config/config.yaml ]] && cp /defaults/config.yaml /config/config.yaml - -# Check if config.yaml exists. If not, copy in -if [ -f /config/config.yaml ]; then - echo "Using existing config file." -else - echo "Creating config.yaml from template." - cp /defaults/config.yaml /config/config.yaml - chown abc:abc /config/config.yaml -fi +chown -R abc:abc /config