HAD Hibernian not been on the wrong end of two missed chances, a questionable red card and an inopportune attack of cramp, Ally McCoist, the Rangers manager, might well have found himself defending his right to stay in a job four days before the league season gets going.
As it is, his team have made it through to the second round of the Petrofac Training Cup by the skin of their teeth thanks to a goal from Nicky Law in extra-time. This was far from an encouraging performance, but at least they escaped from the battle on top in the end.
The war between the existing board at Rangers and the supporters who want them out looks like rumbling on for some considerable time yet, though.
This was a keenly-contested match containing much worthy of commanding attention. However, it was impossible to look around Ibrox last night and not be alarmed by the swathes of empty, blue seats in all four stands.
The Club Deck, the third tier of the Main Stand, was closed. The official attendance was given as 18,138.
Of course, the visit of Hibs was live on BBC Alba and Sunday's match with Hearts is likely to give a more accurate picture of just how many disgruntled fans are likely to stay away this term, but this was not a good start for the men in the directors' box.
It came perilously close to being a catastrophic one for McCoist. His record in cup competitions is little short of awful. Another defeat in this poorly-regarded tournament would have put him under serious pressure. With the scores balanced at 1-1 and Hibs dominating, the jeers could very clearly be heard in the night air. In fairness, Rangers did open brightly last night with Kenny Miller and Kris Boyd reinstalled as the favoured frontline pairing and McCoist trying out a 3-5-2 system that would bite the dust when the going got tough.
With 14 minutes on the clock, Lewis Macleod, continuing his recovery from a virus that laid him low during the second half of last season, put them in front when controlling a cross from Lee Wallace on the right of the area and rifling in a low drive into the far corner.
Boyd then sent a low shot into the corner of the net from 20 yards, the effort disallowed because of an earlier handball, and there seemed little doubt over which team would win.
From about half an hour in, though, Rangers lost their zip and lost their way. It is something Ibrox supporters have become used to over the past couple of seasons against lesser opposition and Hibs seized on it after the interval.
Their first major opportunity came when Liam Craig found Sam Stanton in splendid isolation with a clever forward ball. His weak, mishit effort, easily gathered by Cammy Bell, was so unforgivably wasteful.
The chances would come thick and fast, though, with Danny Handling levelling the scoring in the 59th minute. Marius Zaliukas, who never quite ironed out some of the inconsistencies in his game during his time at Hearts, lost the ball midway inside his own half and put his side in serious trouble.
David Gray played the ball into the box, it bounced around for a while before taking a telling ricochet off Darren McGregor and Handling nipped in to slip it coolly beyond Bell and into the net. Rangers were reeling and there to be beaten.
Farid El Alagui, whose goals helped knock Rangers out of the League Cup three years ago, let them well and truly off the hook.
First up, he volleyed over from inside the area after chesting down a Liam Craig cross and then put a free header from an Alex Harris corner over the bar with 20 minutes to go from just a matter of yards out.
It was with 11 minutes to go that everything changed. The referee, John Beaton, felt Handling had lunged into a tackle with Templeton inside his own half and raised the red card. The Hibs player was furious. It did look a slightly harsh decision and the Edinburgh side, reduced to 10 men, were picked off 11 minutes into extra-time.
A shot from Miller that had been blocked and rolled towards the Main Stand touchline could have been cleared by Scott Robertson had he not been suffering from a crippling bout of cramp.
Despite touching the ball, it travelled barely any distance and Wallace nudged it onto Law, whose terrific curling effort from distance beat Mark Oxley to his left and got his team out of jail.