From 88e11ac29561a4e1718b56f264cfef561596e665 Mon Sep 17 00:00:00 2001 From: edwardro22 Date: Thu, 17 Aug 2017 15:29:07 +0300 Subject: [PATCH] preparation for migrator tool --- build.sh | 4 +++- cmd/cgr-migrator/cgr-migrator.go | 36 ++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100755 cmd/cgr-migrator/cgr-migrator.go diff --git a/build.sh b/build.sh index 5926d6277..72e0c7f36 100755 --- a/build.sh +++ b/build.sh @@ -9,7 +9,9 @@ go install -ldflags "-X 'github.com/cgrates/cgrates/utils.GitLastLog=$GIT_LAST_L cl=$? go install -ldflags "-X 'github.com/cgrates/cgrates/utils.GitLastLog=$GIT_LAST_LOG'" github.com/cgrates/cgrates/cmd/cgr-console cc=$? +go install -ldflags "-X 'github.com/cgrates/cgrates/utils.GitLastLog=$GIT_LAST_LOG'" github.com/cgrates/cgrates/cmd/cgr-migrator +cm=$? go install -ldflags "-X 'github.com/cgrates/cgrates/utils.GitLastLog=$GIT_LAST_LOG'" github.com/cgrates/cgrates/cmd/cgr-tester ct=$? -exit $cr || $cl || $cc || $ct +exit $cr || $cl || $cc || $cm ||$ct diff --git a/cmd/cgr-migrator/cgr-migrator.go b/cmd/cgr-migrator/cgr-migrator.go new file mode 100755 index 000000000..43398f941 --- /dev/null +++ b/cmd/cgr-migrator/cgr-migrator.go @@ -0,0 +1,36 @@ +/* +Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments +Copyright (C) ITsysCOM GmbH + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see +*/ +package main + +import ( + "flag" + "fmt" + + "github.com/cgrates/cgrates/utils" +) +var( + version = flag.Bool("version", false, "Prints the application version.") +) + +func main() { + flag.Parse() + if *version { + fmt.Println(utils.GetCGRVersion()) + return + } +} \ No newline at end of file