use [[ test

This commit is contained in:
Erik Arvstedt 2020-04-07 23:05:08 +02:00
parent 201fc33782
commit 08322eed9b
No known key found for this signature in database
GPG Key ID: 33312B944DD97846

View File

@ -247,10 +247,10 @@ in {
after = [ "network.target" "nix-bitcoin-secrets.target" ]; after = [ "network.target" "nix-bitcoin-secrets.target" ];
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
preStart = '' preStart = ''
if ! test -e ${cfg.dataDir}; then if [[ ! -e ${cfg.dataDir} ]]; then
mkdir -m 0770 -p '${cfg.dataDir}' mkdir -m 0770 -p '${cfg.dataDir}'
fi fi
if ! test -e ${cfg.dataDir}/blocks; then if [[ ! -e ${cfg.dataDir}/blocks ]]; then
mkdir -m 0770 -p '${cfg.dataDir}/blocks' mkdir -m 0770 -p '${cfg.dataDir}/blocks'
fi fi
chmod -R g+rX '${cfg.dataDir}/blocks' chmod -R g+rX '${cfg.dataDir}/blocks'