mirror of
				https://github.com/kevinveenbirkenbach/computer-playbook.git
				synced 2025-10-31 02:10:05 +00:00 
			
		
		
		
	Renamed health services
This commit is contained in:
		
							
								
								
									
										11
									
								
								roles/health-btrfs/files/health-btrfs.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								roles/health-btrfs/files/health-btrfs.sh
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| #!/bin/bash | ||||
| exit_code=0 | ||||
| for path in $(btrfs filesystem show | awk '/ path /{print $NF}') | ||||
| do | ||||
|   echo "Checking health for $path..." | ||||
|   result=$(btrfs device stats $path) | ||||
|   echo "$result" | ||||
|   regex='\.(.*)_errs(\s*)[1-9]' | ||||
|   [[ "$result" =~ $regex ]] && echo "Errors found!" && exit_code=1; | ||||
| done | ||||
| exit $exit_code | ||||
		Reference in New Issue
	
	Block a user