Skip to content

Commit

Permalink
Merge pull request #184 from mariux64/hostconfig-also-create-node-dir…
Browse files Browse the repository at this point in the history
…ectory

hostconfig: Use make_path to create possible non-existing directory `/node`
  • Loading branch information
donald authored Jan 3, 2023
2 parents 707831a + 73a2922 commit 4bc27d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hostconfig/hostconfig
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ sub evalue_expression {
sub populate_node {
my ($hostname)=@_;
my $DIR='/node/tags';
-d $DIR and system "rm -rf $DIR" and exit 1;
mkdir $DIR or die "$DIR: $!\n";
-d $DIR and system 'rm', '-rf', $DIR and exit 1;
system 'mkdir', '-p', $DIR and exit 1;
my $tags=$TAGS{$hostname};
for (keys %$tags) {
open my $touch,'>',"$DIR/$_";
Expand Down

0 comments on commit 4bc27d6

Please sign in to comment.