dhcp-script=/etc/detect_new_device.sh
Reference:
| /* Export Current Tab Titles/URLs to CSV - Script for the Browser Console | |
| NOTE: BEFORE RUNNING THIS SCRIPT, CHECK THIS SETTING: | |
| Type or paste about:config into the address bar and press Enter | |
| Click the button promising to be careful | |
| In the search box type devt and pause while Firefox filters the list | |
| If devtools.chrome.enabled is false, double-click it to toggle to true | |
| Paste this entire script into the command line at the bottom of the Browser Console (Windows: Ctrl+Shift+j) | |
| Then press Enter to run the script. A save dialog should promptly open. |
| // Run code in Browser Console after enabling chrome debugging -- | |
| // about:config => devtools.chrome.enabled => true | |
| // https://developer.mozilla.org/docs/Tools/Browser_Console | |
| try { | |
| var tabPromise = SyncedTabs._internal.getTabClients(); | |
| tabPromise.then((arrDevices) => { | |
| if (arrDevices && arrDevices.length > 0){ | |
| // Generate a string with the format of a bookmark export file | |
| var d, e, out = '<!DOCTYPE NETSCAPE-Bookmark-file-1>\n<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">\n<TITLE>Bookmarks</TITLE>\n<H1>Bookmarks Menu</H1>\n<DL><p>\n'; | |
| const escapeHtmlEntities = function(aText){return (aText || '').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''')}; |
dhcp-script=/etc/detect_new_device.sh
Reference:
Let's say you have a Bash shell script, and you need to run a series of operations on another system (such as via ssh). There are a couple of ways to do this.
First, you can stage a child script on the remote system, then call it, passing along appropriate parameters. The problem with this is you will need to manually keep the remote script updated whenever you change it -- could be a bit of a challenge when you have something to execute on a number of remote servers (i.e., you have a backup script running on a central host, and it needs to put remote databases in hot backup mode before backing them up).
Another option is to embed the commands you want to run remotely within the ssh command line. But then you run into issues with escaping special characters, quoting, etc. This is ok if you only have a couple commands to run, but if it is a complex piece of Bash code, it can get a bit unwieldy.
So, to solve this, you can use a technique called rpcsh -- rpc in shell script, as follows:
First, place th