Fix post installation script to work always

Change-Id: Id47f9f64ed7d690d74d7e774fa78776fd5aacc3e