Ensure to run "bonjour" function only if cowsay is available.
This commit is contained in:
		
							parent
							
								
									f4ed806529
								
							
						
					
					
						commit
						bf91dd9422
					
				
							
								
								
									
										2
									
								
								zlogin
								
								
								
								
							
							
						
						
									
										2
									
								
								zlogin
								
								
								
								
							|  | @ -15,7 +15,7 @@ | |||
| #uptime | ||||
| 
 | ||||
| # If a network connection is available (check function def in zshrc) | ||||
| if ( is_network ); then | ||||
| if [( is_network )] && [ $(command -v cowsay) ]; then | ||||
|   # Affiche un dessin (cf fonction définie dans zshrc) | ||||
|   bonjour | ||||
| fi | ||||
|  |  | |||
							
								
								
									
										2
									
								
								zshrc
								
								
								
								
							
							
						
						
									
										2
									
								
								zshrc
								
								
								
								
							|  | @ -323,7 +323,7 @@ alias ccal='var=$(cal); echo "${var/$(date +%-d)/$(echo -e "\033[1;31m$(date +%- | |||
| function bonjour() { | ||||
|   MIN_TIME=$(date +%M) | ||||
|   MODULO_MIN=$(($MIN_TIME % 2)) | ||||
|   if [ $(command -v bash_quote) ]; then | ||||
|   if [ $(command -v bash_quote) ] && [ $(command -v cowsay) ]; then | ||||
|     if [ $MODULO_MIN -eq 0 ]; then | ||||
|       #echo Bonjour $USER, nous sommes le `date +"%A %e %B %Y"`, et il est : `date +"%H"` h `date +"%M"` | cowsay -f $(/bin/ls /usr/share/cowsay/cows -1 | head -n $(expr $$$(date +%s) % $(ls /usr/share/cowsay/cows | wc -w) + 1) | tail -n 1) | ||||
|       command bash_quote | cowsay -f $(/bin/ls /usr/share/cowsay/cows -1 | head -n $(expr $$$(date +%s) % $(ls /usr/share/cowsay/cows | wc -w) + 1) | tail -n 1) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue