diff options
author | Karel Kočí <cynerd@email.cz> | 2017-04-16 13:52:01 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2017-04-16 13:52:01 +0200 |
commit | 6d0a15ed36267aadb114515ba6aaa85934374e63 (patch) | |
tree | 55a4a341b5e0b75b584e2923502c6784612ce0d8 /service/syncemail | |
parent | f6047ecefcf7a05cb79bac73c259b944aac84d26 (diff) | |
download | myconfigs-6d0a15ed36267aadb114515ba6aaa85934374e63.tar.gz myconfigs-6d0a15ed36267aadb114515ba6aaa85934374e63.tar.bz2 myconfigs-6d0a15ed36267aadb114515ba6aaa85934374e63.zip |
Add syncemail service
Diffstat (limited to 'service/syncemail')
-rwxr-xr-x | service/syncemail | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/service/syncemail b/service/syncemail new file mode 100755 index 0000000..7465676 --- /dev/null +++ b/service/syncemail @@ -0,0 +1,19 @@ +#!/home/cynerd/.local/sbin/user-service.sh +# vim: ft=sh + +description="Mail synchronization tool" +pidfile="/tmp/syncemail-$(id -u).pid" + +status() { + [ -f $pidfile ] || return 1 + kill -0 "$(cat $pidfile)" || return 1 +} + +start() { + ~/.local/sbin/syncemail +} + +stop() { + kill "$(cat $pidfile)" + wait "$(cat $pidfile)" +} |