Auto-shutdown on Linux will only detect connections established via our streaming desktop and web-based terminal. SSH connections will not be detected. Use the following script to set your Linux machine to auto-shutdown during periods of inactivity:
The script can be download from here.
- Place idle_shutdown.sh into /usr/local/bin
- Place idle_shutdown.conf into /etc/init
- Place idle_shutdown into /etc/default and then edit that file and specify the idle time in hours after which to shutdown
Just add the desired number of hours that the system can be idle before being shut down by modifying /etc/default/idle_shutdown
Shutdown after one hour:
Shutdown after one week:
The Auto-Shutdown script automatically starts on boot. Run restart idle_shutdown to apply configuration changes. If you don't want to shutdown on idle anymore, just edit the file in /etc/default and leave it blank, then restart idle_shutdown.
Note: Auto-Shutdown works by detecting changes to the desktop or terminal. If you're simply connected to the terminal or desktop and there are no inputs detected, the machine will assume it is idle.