Ported script to Dash https://github.com/KanoComputing/Spindle/issues/492