The ticking clock and a growing sense of unease among CBS Corp.’s board of directors helped accelerate the settlement talks that will shape the future of CBS and decide the fate of chairman-CEO Leslie Moonves.

Moonves has been on a tightrope for more than a month after sexual harassment allegations were leveled against him by six women in a New Yorker expose published on July 27. The exec was already knee-deep in a battle with CBS’ controlling shareholder, National Amusements Inc. (NAI), over control of the company.

During the Labor Day holiday weekend, settlement discussions on both fronts were held among a small army of lawyers, representatives for NAI and members of CBS’ board. A final exit agreement for Moonves is expected to come together “within days, not weeks,” according to a source close to the situation. Joseph Ianniello, CBS’ chief operating officer, is expected to be named interim CEO while a search for a Moonves successor is conducted.

As for the CBS-NAI legal battle, the goal is to head off the scheduled Oct. 3 start date for the trial in the lawsuit CBS filed against NAI on May 14. A majority of CBS’ board of directors took the extraordinary step of voting to approve a special dividend that would have the effect of diluting NAI’s voting control over CBS — NAI at present owns about 80% of CBS’ voting stock. CBS filed suit in Delaware Chancery Court to seek legal validation for the special dividend. NAI, not surprisingly, fired back at CBS with a countersuit and a vehement defense.

The CBS-NAI battle has split the CBS board between the 11 independent directors and the three panelists who have ties to NAI. The independent directors have backed Moonves’ bold legal strategy, and they opted not to suspend or remove Moonves from his post even after they initiated an investigation into Moonves’ actions and the claims in the New Yorker story, most of which date back decades. Moonves has apologized for making “unwanted advances” but has denied retaliating against women who rebuffed him.

It’s understood that settlement talks between CBS and NAI are being conducted separately from the CBS board’s effort to reach an exit agreement with Moonves. The two issues are inextricably linked, however, given that Moonves was central to the aggressive legal strategy against NAI. Conflict between CBS and NAI erupted earlier this year when NAI, headed by Sumner Redstone and Shari Redstone, pushed Moonves and the CBS board to consider a merger with Viacom, which is also controlled by NAI.

Now, the three members of the CBS board committee overseeing the internal investigation into Moonves’ behavior are key players in the negotiations with CBS’ CEO. Those members are Bruce Gordon, who is CBS’ lead independent director, Robert Klieger, a lawyer for the Redstones, and Linda Griego, another independent CBS director.

Gordon is also a key player in the lawsuit settlement talks with NAI. Klieger and his dual involvement with NAI and CBS has been a focal point of CBS’ litigation.

Moonves recently hired top legal eagle Daniel Petrocelli of O’Melveny and Myers to represent him in CBS’ internal harassment investigation. That was a signal that negotiations would begin. Moonves’ employment contract calls for him to receive a whopping severance package of $180 million or more in cash and stock if he were to be fired without cause, or if he elects to leave for “good reason” such as not being re-elected to CBS’ board.

It’s understood that attorney Ronald Olson of Munger, Tolles and Olson is also working with Moonves at present.

Multiple sources say that the negotiations are centering around a payout of around $120 million as well as provisions that would allow Moonves to save some face after the battle with NAI. Those points would include a commitment from NAI to not merge CBS with Viacom for two years and other measures that would give CBS some autonomy from NAI. Moonves’ camp is also pushing for NAI to adjust elements of the trust that will govern NAI after Sumner Redstone’s death that would make it hard for CBS to be acquired by a larger entity, as reported Thursday by the Wall Street Journal.

Moonves and other CBS board members have balked at the idea of CBS reuniting with Viacom given the latter’s struggles in recent years. Moonves had sought to orchestrate a sale to a larger firm that would cement his legacy as the executive who rescued the ailing in network in the mid-1990s with his crack programming skills, and then set it up for the future through a sale to a strong partner. NAI’s vision of bringing CBS and Viacom together was a speed bump in that plan, which sparked the legal battle. NAI has repeatedly said it would not force a merger of CBS and Viacom if both boards were not in favor of such a deal.

CBS’ 11 independent board members are said to have become increasingly concerned that the prolonged legal battle and the sexual harassment cloud hanging over Moonves was sure to be bad for the company and its shareholders.

The CBS-NAI settlement talks also encompass NAI’s desire to bring new blood into CBS’ board of directors. The promise of new faces coming to the board may have been the spur for Moonves to engage in exit negotiations while the current board is still in place.

Sources said the approach of the trial date was the primary driver of settlement talks on the lawsuit, even as both sides continue to wage war amid a blizzard of motions, subpoenas, and depositions. But NAI also suffered a setback earlier this month when the judge sided with CBS on compelling NAI to produce more documents related to CBS’ claim that NAI breached its fiduciary duty to CBS shareholders, and in allowing a videotape of Sumner Redstone to be included as part of the discovery process.

The video, shot by CBS board member Arnold Kopelson, reportedly shows Sumner Redstone in fragile condition, raising questions about whether he is actually calling the shots at NAI. NAI objected, saying the video was shot without Redstone’s permission.

The settlement talks indicate that both camps are ready to move beyond the nitty gritty of the legal war toward a long-term solution. CBS shares rose 3% in trading Thursday, indicating that investors agree the time has come.