mainwrapper.sh as statix rewrite