#1
|
|||
|
|||
Restart again after update
Hello, how can I cause the jdownloader to restart a second time after an update?
i found the following code but the last line does not do what it says Code:
/* Name: Update and Re-Apply Theme Version: 1.0.1 Author: **External links are only visible to Support Staff** Description: Check for and apply updates periodically if JDownloader 2 is idle, and then restart JDownloader 2 one more time to apply the dark theme properly. Trigger Required: "Interval" (Recommended: 600000 (10 mins.) or more) Synchronous execution: Yes (checked) */ if ( callAPI("update", "isUpdateAvailable") && // an update is available, and !callAPI("linkcrawler", "isCrawling") && // LinkCrawler is idle, and !callAPI("linkgrabberv2", "isCollecting") && // LinkGrabber is idle, and !callAPI("extraction", "getQueue").length && // nothing is being extracted, then isDownloadControllerIdle() // if no downloads are running... ) { callAPI("update", "restartAndUpdate"); // Check for and apply an update, then callAPI("system", "restartJD"); // restart JDownloader 2 again to fix the theme } |
#2
|
|||
|
|||
Quote:
Code:
/* Restart after update Trigger : JDownloader started */ var restart = true; var cur = getPath(JD_HOME + "/build.json"); var old = getPath(JD_HOME + "/tmp/build.json"); try { restart = readFile(old) != readFile(cur); } catch (e) {}; if (restart) { old.delete(); cur.copyTo(old.parent); callAPI("system", "restartJD"); } |
#3
|
|||
|
|||
Alternate version:
Code:
/* Restart after update Trigger : JDownloader started */ var list = ""; var file = JD_HOME + "/revisions.txt"; var revision = callAPI("jd", "getCoreRevision"); try { list = readFile(file); } catch (e) {}; if (list.indexOf(revision) == -1) { writeFile(file, revision + "\r\n", true); callAPI("system", "restartJD"); } |
#4
|
|||
|
|||
@mgpai thank you very much for your prompt reply
|
#5
|
||||
|
||||
@xele3628iw: out of interest, why another restart?
__________________
JD-Dev & Server-Admin |
#6
|
|||
|
|||
Hi Jiaz
because I use BlackEye as a theme did not apply properly after update, so with the second restart it is applied correctly. |
#7
|
|||
|
|||
@jiaz: Pending ticket.
|
#8
|
||||
|
||||
@xele3628iw: Thanks for the feedback. That makes sense
@mgpai: time to get this fixed!
__________________
JD-Dev & Server-Admin |
Thread Tools | |
Display Modes | |
|
|