##Set sleep time
sudo systemsetup -setcomputersleep 60
where 60 is te time in minutes
##Turn of sleep
sudo systemsetup -setcomputersleep Never
##Check current sleep status
sudo systemsetup -getcomputersleep
##Set sleep time
sudo systemsetup -setcomputersleep 60
where 60 is te time in minutes
##Turn of sleep
sudo systemsetup -setcomputersleep Never
##Check current sleep status
sudo systemsetup -getcomputersleep