updated script to auto determine environment variables based on distro