check_systemd_timer: normalize timer name
This commit is contained in:
parent
a92ad76e0d
commit
5e84d7f378
|
@ -21,7 +21,7 @@ done
|
||||||
for disk in "${disks[@]}"; do
|
for disk in "${disks[@]}"; do
|
||||||
echo "Running $1 test on /dev/$disk"
|
echo "Running $1 test on /dev/$disk"
|
||||||
if [ "$1" == "short" ]; then
|
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
|
elif [ "$1" == "long" ]; then
|
||||||
sudo smartctl -t long /dev/$disk > /dev/null || true
|
sudo smartctl -t long /dev/$disk > /dev/null || true
|
||||||
else
|
else
|
||||||
|
|
|
@ -54,6 +54,9 @@ if __name__ == '__main__':
|
||||||
parser.add_argument('-t', '--timer', required=True, help='The name of the timer to check.')
|
parser.add_argument('-t', '--timer', required=True, help='The name of the timer to check.')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
if not args.timer.endswith('.timer'):
|
||||||
|
args.timer = args.timer + '.timer'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
check_timer(args.timer)
|
check_timer(args.timer)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
Loading…
Reference in New Issue