Started övning 4, labb 6

This commit is contained in:
2013-12-19 15:29:29 +01:00
parent 71534704f2
commit b446f85659
7 changed files with 171 additions and 0 deletions

20
Labb6/ovning2.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/bash
# Jack-Benny Persson
# LX13
# Övning 2, labb 6
# Check EUID and empty /tmp/testdir/
# Sanity check
if [ $EUID -ne 0 ]; then
echo "`basename $0` must run as root"
exit 2
fi
rm /tmp/testdir/* 2> /dev/null
if [ $? -ne 0 ]; then
echo "Something went wrong when deleting files in /tmp/testdir/"
exit 2
fi
exit 0