adm_act/adm.sh
2026-06-03 14:20:33 +03:00

22 lines
972 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
pcname=""
onContinue=true
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
if [[ $ans =~ ^([Yy]es|[Yy]|[Дд]а|[Дд])$ ]]; then
onContinue=false
break
elif [[ $ans =~ ^([Nn]o|[Nn]|[Нн]ет|[Нн])$ ]]; then
break
fi
done
fi
done
echo "Начинаем установку для ПК: $pcname"
sudo bash -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
echo "Установка завершена!"