add exercise4.sh
This commit is contained in:
1 parent
52e4ed37fc
commit
e7f3c13fb6
1 file changed
+17
Executable
+17
@@ -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