/scripts/: fixed a bug which made scripts keep living after ending and a bug if DB is not up