I've put together a small script to make using emonhub conf and log files easier to use and automate upgrading emonhub from git. It's work in progress so don't expect too much.
Hopefully in time this stuff will be integral to emonHub or at least its installer but for now this should do ok.
I'm hoping it will be included in the next pre-built SD card but if you have an existing set-up SD or HDD this script will instal just the emonHub command line options file. to instal run (if running read-only use rpi-rw 1st )
The emonhub command can be used with any of these valid options
emonHub utilities
-c or --config Opens the configuration file (emonhub.conf) for editing
-h or --help Displays this help for emonHub utilities command options
-r or --restart Restarts the emonhub service
-s or --start Starts the emonhub service
-u or --update Updates emonhub from the git repository (git pull)
-v or --version Displays the emonHub version installed
-x or --exit Exits emonHub by stopping the emonhub service
emonHub logging
-dl or --display-log Display last 10 log messages and continue to monitor logging
-ol or --open-logfile Open logfile with "nano" text editor
-rl or --reset-logfile Reset the current logfile (deletes any existing log messages!)
-vl or --view-logfile View the entire logfile using "cat"
If running a RO image any instances that require RW mode will take care of that so any of these commands can be used whilst still in RO mode, also without sudo annd if the file system was RO prior to the command it will be returned to RO. So if rpi-rw is used prior to a command it will not return to RO mode.
Paul
EDIT - Changed the attached file as the file was saved on a windows machine which upset linux. should be ok now. but please let me know if not
emonHub command line options
Submitted by pb66 on Sun, 15/02/2015 - 22:21I've put together a small script to make using emonhub conf and log files easier to use and automate upgrading emonhub from git. It's work in progress so don't expect too much.
Hopefully in time this stuff will be integral to emonHub or at least its installer but for now this should do ok.
I'm hoping it will be included in the next pre-built SD card but if you have an existing set-up SD or HDD this script will instal just the emonHub command line options file. to instal run (if running read-only use rpi-rw 1st )
wget http://openenergymonitor.org/emon/sites/default/files/emonhub_utilities_... -O ~/hub_utils.sh
chmod +x ~/hub_utils.sh && ~/hub_utils.sh
The emonhub command can be used with any of these valid options
emonHub utilities
-c or --config Opens the configuration file (emonhub.conf) for editing
-h or --help Displays this help for emonHub utilities command options
-r or --restart Restarts the emonhub service
-s or --start Starts the emonhub service
-u or --update Updates emonhub from the git repository (git pull)
-v or --version Displays the emonHub version installed
-x or --exit Exits emonHub by stopping the emonhub service
emonHub logging
-dl or --display-log Display last 10 log messages and continue to monitor logging
-ol or --open-logfile Open logfile with "nano" text editor
-rl or --reset-logfile Reset the current logfile (deletes any existing log messages!)
-vl or --view-logfile View the entire logfile using "cat"
If running a RO image any instances that require RW mode will take care of that so any of these commands can be used whilst still in RO mode, also without sudo annd if the file system was RO prior to the command it will be returned to RO. So if rpi-rw is used prior to a command it will not return to RO mode.
Paul
EDIT - Changed the attached file as the file was saved on a windows machine which upset linux. should be ok now. but please let me know if not