Former general sworn in as army chief by internationally recognised government in Tobruk as warplanes attack Tripoli.