output version

This commit is contained in:
Usman Nasir
2020-02-10 22:31:23 +05:00
parent 63a0933b45
commit b531dca656
2 changed files with 10 additions and 11 deletions

View File

@@ -1312,6 +1312,16 @@ def main():
command = '/usr/bin/cyberpanel_utility --help'
ProcessUtilities.executioner(command)
elif args.function == 'version' or args.function == 'v' or args.function == 'V':
## Get CurrentVersion
with open('/usr/local/CyberCP/version.txt') as file:
file_contents = file.read()
version = re.search('\d.\d', file_contents)
version = version.group()
build = file_contents[-2:]
build = build[0:1]
currentversion = version + '.' + build
print (currentversion)