Hi, Look at this, it can give you a hint:
If it does not work, I think you should rely on external script (bash,python,php…whatever suits you).