They did in fact do everything of which they could think to avoid firing on Sumter.
General Beauregard sent word to Major Anderson that Union warships would be arriving soon, and that they might possibly attack Beauregard's forces, and if Anderson would refrain from firing at Beauregard's forces, He would refrain from firing on Anderson.
Anderson responded that if the Confederates fired at any ship bearing the Union flag, he would use all the force at his disposal against them.
So Beauregard was informed that he would have to face enemy fire from the Fort and from the Ships simultaneously.
His choice was to neutralize the fort immediately before the rest of the ships arrived, or face both the ships and the fort with a likely subsequent greater loss of his men.
What would you have done?
The tragedy is that Anderson had already written up the evacuation order and that if those ships hadn't arrived, Anderson and his men were going to leave the fort in another day or so.
And by the way, Anderson himself wrote that it was a nasty dirty deed the way Lincoln sent those ships to attack them after everyone had been led to believe such a thing would not be done.
What would I have done?
I woulda sent a nasty dirty telegram to Lincoln and others saying that they broke their word but I refuse to fire on this fort.
Of course, that’s with hindsight being 20/20. Nowadays, quite a bit of that kind of required restraint is in the training manuals, but probably not nearly enough, because shiite happens.