Prevented error when no servers have been created.

This commit is contained in:
Marcus Whybrow 2012-06-04 21:40:33 +01:00
parent d9da25cc0e
commit 738c2b9e87

View File

@ -1505,6 +1505,7 @@ init() {
num_worlds=0
num_servers=0
if [ -d "$SERVER_STORAGE_PATH" ]; then
local id=0
while IFS= read -r -d $'\0' path; do
local name="$(basename "$path")"
@ -1512,6 +1513,7 @@ init() {
id="$(($id+1))"
num_servers="$id"
done < <(find "$SERVER_STORAGE_PATH" -mindepth 1 -maxdepth 1 -type d -print0)
fi
}
# Called if the script is interrupted before exiting naturally