I am trying to understand what -e /sudoers.tmp -o "$(pidof visudo)"
does in the following code snippet.
#!/bin/bash
if [ -e /etc/sudoers.tmp -o "$(pidof visudo)" ]; then
echo "/etc/sudoers busy, try again later"
exit 1
fi
cp /etc/sudoers /etc/sudoers.bak
cp /etc/sudoers /etc/sudoers.tmp
chmod 0640 /etc/sudoers.tmp
echo "whatever" >> /etc/sudoers.tmp
chmod 0440 /etc/sudoers.tmp
mv /etc/sudoers.tmp /etc/sudoers
exit 0
Appreciate an elaboration on that specific condition.