From b5378252fdadb6425f46e451a3a7c0395f1f3dc4 Mon Sep 17 00:00:00 2001 From: Digimer Date: Fri, 8 Feb 2019 15:21:24 -0500 Subject: [PATCH] * Create the shell for the new anvil-manage-files tool. Signed-off-by: Digimer --- tools/anvil-manage-files | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 tools/anvil-manage-files diff --git a/tools/anvil-manage-files b/tools/anvil-manage-files new file mode 100755 index 00000000..ce30f2f6 --- /dev/null +++ b/tools/anvil-manage-files @@ -0,0 +1,43 @@ +#!/usr/bin/perl +# +# This handles moving around and managing files on Anvil! nodes, DR hosts and Striker dashboards. +# +# Exit codes; +# 0 = Normal exit or md5sum of this program changed and it exited to reload. +# 1 = +# 2 = +# +# TODO: +# - +# +# NOTE: +# - +# + +use strict; +use warnings; +use Anvil::Tools; +use Data::Dumper; + + +# Disable buffering +$| = 1; + +my $THIS_FILE = ($0 =~ /^.*\/(.*)$/)[0]; +my $running_directory = ($0 =~ /^(.*?)\/$THIS_FILE$/)[0]; +if (($running_directory =~ /^\./) && ($ENV{PWD})) +{ + $running_directory =~ s/^\./$ENV{PWD}/; +} + +my $anvil = Anvil::Tools->new(); + + + +# We're done +$anvil->nice_exit({exit_code => 0}); + + +############################################################################################################# +# Private functions. # +#############################################################################################################