# my set of scripts in daily management of jails



## zomar (Jul 23, 2020)

Hello, 

I'm testing great GIT tool and I would share with you some script which I use in daily jail management.

I'm not using any jail management packages, only THICK jails, freebsd jail vanila tools and ZFS.

I'm also not an expert in sh scripting.

Scripts are very basic and I think self explanatory.

I hope that I do not made any horrible mistakes. It's just working for me.

!!! Read script before you will use it. You run it on your risk.!!!

If you have any comments just "shoot me".

Tools github link: https://github.com/zomar7676/jail-tools

BR
zomar


----------



## CyberCr33p (Jul 24, 2020)

```
LIST=`jls name | grep "$JAIL_NAME" | wc -l`
```

will match jailname, somethingelsejailname, etc so it will give wrong result if a jail exists or not.

Replace it with:


```
LIST=`jls name | grep '^'"$JAIL_NAME"'$' | wc -l`
```


----------



## zomar (Jul 24, 2020)

Done, Thank You.


----------



## mark_j (Jul 24, 2020)

Nice work. Add your licence to GIT, though. Just so you get credit where credit's due.


----------



## zomar (Jul 25, 2020)

License added. Never thought about it


----------



## mark_j (Jul 26, 2020)

I mean licenses really don't mean that much but honest people who use/enhance your work will at least give you kudos for it.
Also add tags for os/jails?


----------

