check_systemd_timer: normalize timer name

This commit is contained in:
Cyberes 2024-02-28 14:47:10 -07:00
parent a92ad76e0d
commit 5e84d7f378
2 changed files with 4 additions and 1 deletions

View File

@ -21,7 +21,7 @@ done
for disk in "${disks[@]}"; do
echo "Running $1 test on /dev/$disk"
if [ "$1" == "short" ]; then
sudo smartctl -t short /dev/$disk > /dev/null || true
sudo smartctl -t short /dev/$disk > /dev/null || true # ignore any errors running the smart command
elif [ "$1" == "long" ]; then
sudo smartctl -t long /dev/$disk > /dev/null || true
else

View File

@ -54,6 +54,9 @@ if __name__ == '__main__':
parser.add_argument('-t', '--timer', required=True, help='The name of the timer to check.')
args = parser.parse_args()
if not args.timer.endswith('.timer'):
args.timer = args.timer + '.timer'
try:
check_timer(args.timer)
except Exception as e: