Update direct.py

Check config before restart and restart only if check config return no error