updated bash pi script for linux