|
1 | 1 | # WPEPluginLauncher |
| 2 | + |
2 | 3 | Plugin to "Launch" linux applications and scripts |
| 4 | + |
| 5 | +## Quick start |
| 6 | + |
| 7 | +### How to launch a script/application |
| 8 | + |
| 9 | +1. Build launcher plugin. It create /usr/lib/wpeframework/plugins/libWPEFrameworkLauncher.so and /root/etc/WPEFramework/plugins/Launcher.json |
| 10 | + |
| 11 | + Generated Launcher.json contains, |
| 12 | + ``` |
| 13 | + { |
| 14 | + "locator":"libWPEFrameworkLauncher.so", |
| 15 | + "classname":"Launcher", |
| 16 | + "precondition":[ |
| 17 | + "Platform" |
| 18 | + ], |
| 19 | + "autostart":true |
| 20 | + } |
| 21 | + ``` |
| 22 | + |
| 23 | +2. Update Launcher.json with the command to be run |
| 24 | + |
| 25 | + E.g. to run command < `du -a /etc` > |
| 26 | + ``` |
| 27 | + { |
| 28 | + "locator":"libWPEFrameworkLauncher.so", |
| 29 | + "classname":"Launcher", |
| 30 | + "precondition":[ |
| 31 | + "Platform" |
| 32 | + ], |
| 33 | + "autostart":true, |
| 34 | + "configuration": { |
| 35 | + "command":"du" |
| 36 | + } |
| 37 | + } |
| 38 | + ``` |
| 39 | + |
| 40 | +3. Update json field:"paramters" with options/values if required |
| 41 | + |
| 42 | + E.g. to run < `du -a /etc -h` > |
| 43 | + ``` |
| 44 | + { |
| 45 | + "locator":"libWPEFrameworkLauncher.so", |
| 46 | + "classname":"Launcher", |
| 47 | + "precondition":[ |
| 48 | + "Platform" |
| 49 | + ], |
| 50 | + "autostart":true, |
| 51 | + "configuration": { |
| 52 | + "command":"du", |
| 53 | + "parameters": [ |
| 54 | + { "option": "-a", "value": "/etc" }, |
| 55 | + { "option": "-h"} |
| 56 | + ] |
| 57 | + } |
| 58 | + } |
| 59 | + ``` |
| 60 | + |
| 61 | +### How to schedule an application/script |
| 62 | + |
| 63 | +1. Add schedule time information to the Launcher.json in the HH:MM.SS format (Hour:Minute.Second) |
| 64 | + ``` |
| 65 | + "configuration": { |
| 66 | + "command":"du", |
| 67 | + "parameters": [ |
| 68 | + { "option": "-a", "value": "/etc" }, |
| 69 | + { "option": "-h"} |
| 70 | + ], |
| 71 | + "schedule": { |
| 72 | + "time": "06:04.10" |
| 73 | + } |
| 74 | + } |
| 75 | + ``` |
| 76 | +Note: If time value is "00:00.00"/invalid format/not set, the launcher will ignore the given time and launch the application at the launcher activation time itself. |
| 77 | + |
| 78 | +### How to schedule an application/script to run in an interval |
| 79 | + |
| 80 | +1. Add interval time information to the Launcher.json in the HH:MM.SS format (Hour:Minute.Second) |
| 81 | + ``` |
| 82 | + "configuration": { |
| 83 | + "command":"du", |
| 84 | + "parameters": [ |
| 85 | + { "option": "-a", "value": "/etc" }, |
| 86 | + { "option": "-h"} |
| 87 | + ], |
| 88 | + "schedule": { |
| 89 | + "time": "06:04.10", |
| 90 | + "interval": "00:40.10" |
| 91 | + } |
| 92 | + } |
| 93 | + ``` |
| 94 | + |
| 95 | +Note: If interval value is "00:00.00"/invalid format/not set, the launcher will treat it as invalid value and ignore the interval time settings. |
| 96 | + |
| 97 | +# How to launch multiple scripts/applcations |
| 98 | + |
| 99 | +E.g. |
| 100 | +``` testapp1, testapp2 and testapp3 are the three applications to be run ``` |
| 101 | + |
| 102 | +1. Create testapp1.json by copying Launcher.json (cp Launcher.json testapp1.json) and update with proper commands and option/values |
| 103 | + |
| 104 | +2. Create testapp2.json by copying Launcher.json (cp Launcher.json testapp2.json) and update with proper commands and option/values |
| 105 | + |
| 106 | +3. Create testapp3.json by copying Launcher.json (cp Launcher.json testapp3.json) and update with proper commands and options/values |
| 107 | + |
| 108 | +4. Run WPEFramework |
| 109 | + |
0 commit comments