The US president said 'you never know' if it could be linked to the war, adding that investigators were working to determine the shooter’s motive.