Commit e9283213 authored by Eugene Kolomeetz's avatar Eugene Kolomeetz Committed by Pavel Emelyanov

scripts: detect EOF on read in a usual way in systemd-autofs-restart.sh

When read bultin detects EOF, it sets empty string as value of specified
variable, and returns non-zero exit code. So we can rely just on exit
code, and not check variable value. This is standard approach.
https://jira.sw.ru/browse/PSBM-44207Signed-off-by: 's avatarEugene Kolomeetz <klm@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 45538c08
......@@ -59,7 +59,7 @@ function check_fs_type {
local top_mount_id=""
local top_mount_fs_type=""
while IFS='' read -r line || [[ -n "$line" ]]; do
while IFS='' read -r line; do
# Skip those entries which do not match the mountpoint
[ "$(echo $line | awk '{print $5;}')" = "$mountpoint" ] || continue
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment