Adding mail syncing with home server
This commit is contained in:
8
systemd/.config/systemd/user/syncmail.service
Normal file
8
systemd/.config/systemd/user/syncmail.service
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Sync mail with Rhea
|
||||||
|
RefuseManualStart=no
|
||||||
|
RefuseManualStop=yes
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/home/powellc/.config/systemd/user/syncmail.sh
|
||||||
11
systemd/.config/systemd/user/syncmail.sh
Executable file
11
systemd/.config/systemd/user/syncmail.sh
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
STATE=`nmcli networking connectivity`
|
||||||
|
|
||||||
|
if [ $STATE = 'full' ]
|
||||||
|
then
|
||||||
|
muchsync rhea.unbl.ink
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "No internet connection"
|
||||||
|
exit 0
|
||||||
13
systemd/.config/systemd/user/syncmail.timer
Normal file
13
systemd/.config/systemd/user/syncmail.timer
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Sync mail with rhea every 3 minutes
|
||||||
|
RefuseManualStart=no
|
||||||
|
RefuseManualStop=no
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
Persistent=false
|
||||||
|
OnBootSec=3min
|
||||||
|
OnUnitActiveSec=3min
|
||||||
|
Unite=syncmail.service
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
||||||
Reference in New Issue
Block a user