diff --git a/adm.sh b/adm.sh index 11f9c6e..3087f02 100644 --- a/adm.sh +++ b/adm.sh @@ -1,12 +1,12 @@ #!/bin/bash pcname="" onContinue=true -while $onContinue; do +while [ "$onContinue" = "true" ]; do read -p "Введите номер пк: A-PC-KC-" pcname pcname="A-PC-KC-$pcname" if [[ $pcname =~ ^A-PC-KC-[0-9]{2}$ ]]; then while true; do - read -p "Имя ПК $pcname. Сохранить? [y/n]" ans + read -p "Имя ПК $pcname. Сохранить? [y/n] " ans if [[ $ans =~ ^([Yy]es|[Yy]|[Дд]а|[Дд])$ ]]; then onContinue=false break @@ -16,4 +16,4 @@ while $onContinue; do done fi done -su -c "apt-get update && apt-get install task-auth-ad-sssd -y && system-auth write ad mtuci.adm $pcname MTUCI 'vvod' ':TcyMH@DEy4tE6xls4>S@GQJbM_SwX'" \ No newline at end of file +su -c "apt-get update && apt-get install task-auth-ad-sssd -y && system-auth write ad mtuci.adm $pcname MTUCI 'vvod' ':TcyMH@DEy4tE6xls4>S@GQJbM_SwX'" || exit 1 \ No newline at end of file