Added adm.sh

This commit is contained in:
snippetsx 2026-06-03 14:02:33 +03:00
commit 04228bea32

19
adm.sh Normal file
View File

@ -0,0 +1,19 @@
#!/bin/bash
pcname=""
onContinue=true
while $onContinue; 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
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'"