From a67f91b171ab03afc6d6bb65203950341cfcd34f Mon Sep 17 00:00:00 2001 From: akanealw Date: Sat, 6 Jan 2024 01:08:14 -0600 Subject: [PATCH] added check for backupserver --- debian/debian-essentials.sh | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/debian/debian-essentials.sh b/debian/debian-essentials.sh index 0305d40..2dc7667 100755 --- a/debian/debian-essentials.sh +++ b/debian/debian-essentials.sh @@ -405,18 +405,21 @@ systemctl restart sshd # lock root -if [[ -d /home/akanealw ]] +isInFile=$(cat /etc/hostname | grep -c "BackupServer") +if [ $isInFile -eq 0 ] then - isInFile=$(cat /etc/shadow | grep -c 'root:!') - if [ $isInFile -eq 0 ] - then - passwd -l root - skill -KILL -u root - exit - else - echo "root account already locked." - exit - fi - else - echo "akanealw account not found, not locking root." + if [[ -d /home/akanealw ]] + then + isInFile=$(cat /etc/shadow | grep -c 'root:!') + if [ $isInFile -eq 0 ] + then + passwd -l root + skill -KILL -u root + exit + else + echo "root account already locked." + exit + fi + else + echo "akanealw account not found, not locking root." fi