Rotate stack script using AP SH output