autowake.cpp : refactored + added : autowake.sh