yandex-cloud / examples

Examples of code, configuration files etc. to be used with Yandex Cloud.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yc-image-cleanup.sh поведение в случае незаполненной переменной YCCLEANUP_SYS_USER

tarwirdur opened this issue · comments

https://github.com/yandex-cloud/examples/blob/master/products-prepare/linux/yc-image-cleanup.sh

    if [ ! -z "$YCCLEANUP_SYS_USER" ]; then
     ...
    fi
    echo "DONE"

Removing system user... DONE выводится вне зависимости от того был удален пользователь или нет.
Может стоит выводить предупрежение или писать SKIPPED вместо DONE?

Ещё можно было бы добавить опцию, которая возьмет имя системного пользователя из $SUDO_USER.