added check for backupserver
This commit is contained in:
Vendored
+16
-13
@@ -405,18 +405,21 @@ systemctl restart sshd
|
|||||||
|
|
||||||
|
|
||||||
# lock root
|
# lock root
|
||||||
if [[ -d /home/akanealw ]]
|
isInFile=$(cat /etc/hostname | grep -c "BackupServer")
|
||||||
|
if [ $isInFile -eq 0 ]
|
||||||
then
|
then
|
||||||
isInFile=$(cat /etc/shadow | grep -c 'root:!')
|
if [[ -d /home/akanealw ]]
|
||||||
if [ $isInFile -eq 0 ]
|
then
|
||||||
then
|
isInFile=$(cat /etc/shadow | grep -c 'root:!')
|
||||||
passwd -l root
|
if [ $isInFile -eq 0 ]
|
||||||
skill -KILL -u root
|
then
|
||||||
exit
|
passwd -l root
|
||||||
else
|
skill -KILL -u root
|
||||||
echo "root account already locked."
|
exit
|
||||||
exit
|
else
|
||||||
fi
|
echo "root account already locked."
|
||||||
else
|
exit
|
||||||
echo "akanealw account not found, not locking root."
|
fi
|
||||||
|
else
|
||||||
|
echo "akanealw account not found, not locking root."
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user