add exercise4.sh
This commit is contained in:
17
shell_scripting_succinctly/exercise4.sh
Executable file
17
shell_scripting_succinctly/exercise4.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
FILE_NAME="/etc/shadow"
|
||||
|
||||
if [ -e $FILE_NAME ]
|
||||
then
|
||||
echo "Shadow passwords are enabled."
|
||||
if [ -w $FILE_NAME ]
|
||||
then
|
||||
echo "You have permissions to edit /etc/shadow."
|
||||
else
|
||||
echo "You DO NOT have permissions to edit /etc/shadow"
|
||||
fi
|
||||
else
|
||||
exit
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user