Skip to content
Snippets Groups Projects
Commit 43f477b0 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

small update for readme

parent bdd0cfe9
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,6 @@ licence: Free software GNU GPL 3.0 ...@@ -12,7 +12,6 @@ licence: Free software GNU GPL 3.0
Source: https://git-repo.iml.unibe.ch/open-source/onfilechange Source: https://git-repo.iml.unibe.ch/open-source/onfilechange
## Installation ## Installation
* Copy the bash script somewhere you like. * Copy the bash script somewhere you like.
...@@ -22,20 +21,20 @@ Source: https://git-repo.iml.unibe.ch/open-source/onfilechange ...@@ -22,20 +21,20 @@ Source: https://git-repo.iml.unibe.ch/open-source/onfilechange
``` ```
Parameters Parameters
-c [command] -c [command]
command to execute on a file change command to execute on a file change
-f [filename(s)] -f [filename(s)]
filenames to watch; separate multiple files with space and put all in quotes filenames to watch; separate multiple files with space and put all in quotes
-h -h
show this help show this help
-i -i
force inotifywait command force inotifywait command
-s -s
force stats command force stats command
-v -v
verbose mode; enable showing debug output verbose mode; enable showing debug output
-w [integer] -w [integer]
for stats mode: wait time in seconds betweeen each test or on missing file; default: 5 sec for stats mode: wait time in seconds betweeen each test or on missing file; default: 5 sec
``` ```
...@@ -50,6 +49,10 @@ Each time you touch the testfile it should show "hello". ...@@ -50,6 +49,10 @@ Each time you touch the testfile it should show "hello".
## Use as systemd service ## Use as systemd service
With running the script as a service can be helpful if you administrate servers and habe developer teams with limited access. Instead of giving sudo permissions you can watch a touchfile to execute something specific as root, i.e. restart Apache httpd. In the real world this file would be touched during an automated deploy process.
Below is just an example service watching a dummy file in /tmp directory.
In `/etc/systemd/system/` create a service config file **onfilechange-demo.service** In `/etc/systemd/system/` create a service config file **onfilechange-demo.service**
``` ```
...@@ -70,6 +73,6 @@ Type=simple ...@@ -70,6 +73,6 @@ Type=simple
WantedBy=multi-user.target WantedBy=multi-user.target
``` ```
Check if the service exists `systemctl status onfilechange-demo`. If so you can start and stop it with `systemctl [start|stop] onfilechange-demo` Check if the service exists `systemctl status onfilechange-demo`. If so you can start and stop it with `systemctl [start|stop] onfilechange-demo`
To start the service on reboot you additionally need to enable it: `systemctl enable onfilechange-demo`.
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment