Modified script to be compatible with all OS and not only debian