This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check sudo rights | |
if [[ "$EUID" = 0 ]]; then | |
echo "Already root" | |
else | |
sudo -k # make sure to ask for password on next sudo | |
if sudo false; then | |
echo "Wrong password" | |
exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check sudo rights | |
if [[ "$EUID" = 0 ]]; then | |
echo "Already root" | |
else | |
sudo -k # make sure to ask for password on next sudo | |
if sudo false; then | |
echo "Wrong password" | |
exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check sudo rights | |
if [[ "$EUID" = 0 ]]; then | |
echo "Already root" | |
else | |
sudo -k # make sure to ask for password on next sudo | |
if sudo false; then | |
echo "Wrong password" | |
exit 1 |