mirror of
				https://github.com/ItsDrike/dotfiles.git
				synced 2025-10-31 07:56:36 +00:00 
			
		
		
		
	Handle existing TMOUT
This commit is contained in:
		
							parent
							
								
									21ed7524ee
								
							
						
					
					
						commit
						c24780f264
					
				
					 1 changed files with 12 additions and 5 deletions
				
			
		|  | @ -4,13 +4,20 @@ | |||
| # This will only be applied for non-graphical sessions, | ||||
| # or whenever root account is logged in | ||||
| 
 | ||||
| TMOUT=600 | ||||
| readonly TMOUT | ||||
| # If TMOUT was already set, unset it | ||||
| unset TMOUT | ||||
| 
 | ||||
| [ -z "$DISPLAY" ] && export TMOUT; | ||||
| # Define the timeout delay (seconds) | ||||
| TIMEOUT=600 | ||||
| 
 | ||||
| # Set TMOUT when display is not set | ||||
| [ -z "$DISPLAY" ] && export TMOUT=$TIMEOUT; | ||||
| 
 | ||||
| # Set TMOUT when in TTY | ||||
| case $(/usr/bin/tty) in | ||||
| 	/dev/tty[0-9]*) export TMOUT;; | ||||
| 	/dev/tty[0-9]*) export TMOUT=$TIMEOUT;; | ||||
| esac | ||||
| 
 | ||||
| [ $UID -eq 0 ] && export TMOUT; | ||||
| # Set TMOUT when user is root | ||||
| [ $UID -eq 0 ] && export TMOUT=$TIMEOUT; | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue