| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -360,6 +360,26 @@ def createFile(session, args): | |||
| 360 | 360 | ||
| 361 | 361 | return txt | |
| 362 | 362 | ||
| 363 | + @echo | ||
| 364 | + def createFileInDomr(session, args): | ||
| 365 | + file_path = args['filepath'] | ||
| 366 | + file_contents = args['filecontents'] | ||
| 367 | + domrip = args['domrip'] | ||
| 368 | + try: | ||
| 369 | + tmpfile = util.pread2(['mktemp']).strip() | ||
| 370 | + f = open(tmpfile, "w") | ||
| 371 | + f.write(file_contents) | ||
| 372 | + f.close() | ||
| 373 | + target = "root@" + domrip + ":" + file_path | ||
| 374 | + util.pread2(['scp','-P','3922','-q','-o','StrictHostKeyChecking=no','-i','/root/.ssh/id_rsa.cloud',tmpfile, target]) | ||
| 375 | + util.pread2(['rm',tmpfile]) | ||
| 376 | + txt = 'success' | ||
| 377 | + except: | ||
| 378 | + util.SMlog(" failed to create HA proxy cfg file ") | ||
| 379 | + txt = '' | ||
| 380 | + | ||
| 381 | + return txt | ||
| 382 | + | ||
| 363 | 383 | @echo | |
| 364 | 384 | def deleteFile(session, args): | |
| 365 | 385 | file_path = args["filepath"] | |
@@ -1452,4 +1472,5 @@ if __name__ == "__main__": | |||
| 1452 | 1472 | "setLinkLocalIP":setLinkLocalIP, | |
| 1453 | 1473 | "cleanup_rules":cleanup_rules, | |
| 1454 | 1474 | "bumpUpPriority":bumpUpPriority, | |
| 1475 | + "createFileInDomr":createFileInDomr, | ||
| 1455 | 1476 | "kill_copy_process":kill_copy_process}) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments