#!/bin/env python

import sys
import subprocess
import base64
import datetime

exec_str = base64.b64decode(sys.argv[1])

print("INFO : start {}".format(datetime.datetime.utcnow()))
print("INFO : exec string: {}".format(exec_str))

p = subprocess.Popen(exec_str.decode(), stdout=sys.stdout, stderr=sys.stderr,
                     shell=True, universal_newlines=True)
retcode = p.wait()
print("INFO : end {} with retcode={}".format(datetime.datetime.utcnow(), retcode))
exit(retcode)

