added &> /dev/null at the end of the command to prevent spam in tty
This commit is contained in:
parent
ea38d70886
commit
e2a7b32961
|
@ -24,13 +24,12 @@ print("Started!")
|
|||
|
||||
# Script
|
||||
while True:
|
||||
output = subprocess.check_output('ipmitool sdr list | grep "Chassis Intru"', shell=True).decode()
|
||||
output = subprocess.check_output('ipmitool sdr list &> /dev/null | grep "Chassis Intru" &> /dev/null', shell=True).decode()
|
||||
|
||||
for line in output.splitlines():
|
||||
if 'Chassis Intru' in line:
|
||||
status = line.split('|')[1].strip()
|
||||
print(f"Current Status: {status}")
|
||||
if status == '0x01':
|
||||
print("TRIGGERED! Running Command...")
|
||||
print(f"{status} CHASSIS INTRUSION DETECTED! Running Command...")
|
||||
subprocess.run(command, shell=True)
|
||||
time.sleep(rescan_delay)
|
||||
|
|
Loading…
Reference in New Issue