Skip to content

Commit e59f4bd

Browse files
committed
[fix] : Fixed SC2086
1 parent 440a38b commit e59f4bd

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

tools/wizard.sh

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -658,19 +658,13 @@ Function_Global_Ask_channel () {
658658
Function_Global_Ask_owner () {
659659
local Function_Local_check_user
660660
Function_Local_check_user () {
661-
if [[ $(getent passwd "${1}" > /dev/null ; printf "${?}") = 0 ]]; then
662-
if [[ -z $1 ]]; then
663-
echo -n "false"
664-
fi
665-
echo -n "true"
666-
else
667-
echo -n "false"
668-
fi
661+
[[ -z "${1+SET}" ]] && return 2
662+
getent passwd "${1}" > /dev/null && return 0 || return 1
669663
}
670664

671665
msg_n "イメージファイルの所有者を入力してください。: " "Enter the owner of the image file.: "
672666
read -r Var_Global_iso_owner
673-
if [[ $(Function_Local_check_user ${Var_Global_iso_owner}) = false ]]; then
667+
if Function_Local_check_user "${Var_Global_iso_owner}"; then
674668
echo "ユーザーが存在しません。"
675669
Function_Global_Ask_owner
676670
return 0

0 commit comments

Comments
 (0)