aboutsummaryrefslogtreecommitdiff
path: root/src/mkjail
diff options
context:
space:
mode:
Diffstat (limited to 'src/mkjail')
-rwxr-xr-xsrc/mkjail8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mkjail b/src/mkjail
index 0b6adb3..3be3efb 100755
--- a/src/mkjail
+++ b/src/mkjail
@@ -97,8 +97,12 @@ function jailist_update {
# update the jail list file
# usage: jailist_update <jail-path>
- if ! grep -q "^$1" $JAIL_LIST; then
- echo $1 >> $JAIL_LIST
+ if [ -f "$JAIL_LIST" ]; then
+ if ! grep -q "^$1" $JAIL_LIST; then
+ echo $1 >> $JAIL_LIST
+ fi
+ else
+ echo $1 > $JAIL_LIST
fi
}