Update adm.sh

reloaded script
This commit is contained in:
snippetsx 2026-06-03 14:10:35 +03:00
parent 04228bea32
commit 32597eaf97

6
adm.sh
View File

@ -1,12 +1,12 @@
#!/bin/bash #!/bin/bash
pcname="" pcname=""
onContinue=true onContinue=true
while $onContinue; do while [ "$onContinue" = "true" ]; do
read -p "Введите номер пк: A-PC-KC-" pcname read -p "Введите номер пк: A-PC-KC-" pcname
pcname="A-PC-KC-$pcname" pcname="A-PC-KC-$pcname"
if [[ $pcname =~ ^A-PC-KC-[0-9]{2}$ ]]; then if [[ $pcname =~ ^A-PC-KC-[0-9]{2}$ ]]; then
while true; do while true; do
read -p "Имя ПК $pcname. Сохранить? [y/n]" ans read -p "Имя ПК $pcname. Сохранить? [y/n] " ans
if [[ $ans =~ ^([Yy]es|[Yy]|[Дд]а|[Дд])$ ]]; then if [[ $ans =~ ^([Yy]es|[Yy]|[Дд]а|[Дд])$ ]]; then
onContinue=false onContinue=false
break break
@ -16,4 +16,4 @@ while $onContinue; do
done done
fi fi
done 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'" 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