mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-07-06 17:48:38 +02:00
enhancement: https://app.clickup.com/t/866at448g
This commit is contained in:
@@ -1141,29 +1141,12 @@ team_drive =
|
||||
|
||||
@staticmethod
|
||||
def DeleteRepoScheduleV2(website, repo, eu):
|
||||
import shutil
|
||||
try:
|
||||
finalConfigPath = f'/home/{website}/.config/rclone/rclone.conf'
|
||||
|
||||
if os.path.exists(finalConfigPath):
|
||||
command = f'cat {finalConfigPath}'
|
||||
result = ProcessUtilities.outputExecutioner(command, eu)
|
||||
new_lines = []
|
||||
skip_section = False
|
||||
|
||||
for line in result.split('\n'):
|
||||
if line.strip().startswith('[') and line.strip().endswith(']'):
|
||||
if line.strip() == f'[{repo}]':
|
||||
skip_section = True
|
||||
else:
|
||||
skip_section = False
|
||||
|
||||
if not skip_section:
|
||||
new_lines.append(line)
|
||||
|
||||
cmd = f'echo "{new_lines}" > {finalConfigPath}'
|
||||
result = ProcessUtilities.outputExecutioner(cmd, eu, True)
|
||||
|
||||
command = f"sed -i '/\[{repo}\]/,/^$/d' {finalConfigPath}"
|
||||
ProcessUtilities.outputExecutioner(command, eu, True)
|
||||
|
||||
|
||||
return 1, 'Done'
|
||||
|
||||
Reference in New Issue
Block a user