diff options
author | nachoparker <nacho@ownyourbits.com> | 2017-07-30 18:17:23 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2017-08-11 00:17:56 +0300 |
commit | 6257eb6b6d5cca2463b512749a32f1c9efb2cbbb (patch) | |
tree | 6af22bbf9471637c16fc4f9124614cbbd2bc00c5 | |
parent | 90dd8d668946d5ae73fd0582647e394011be5f92 (diff) |
refactor nc-scan-autov0.17.20
-rw-r--r-- | etc/nextcloudpi-config.d/nc-scan-auto.sh | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/etc/nextcloudpi-config.d/nc-scan-auto.sh b/etc/nextcloudpi-config.d/nc-scan-auto.sh index 81235944..ef7c5d7e 100644 --- a/etc/nextcloudpi-config.d/nc-scan-auto.sh +++ b/etc/nextcloudpi-config.d/nc-scan-auto.sh @@ -28,6 +28,21 @@ show_info() 20 90 } +install() +{ + cat > /etc/systemd/system/nc-scan.service <<EOF +[Unit] +Description=Scan NC for externally modified files + +[Service] +Type=simple +ExecStart=/usr/local/bin/ncp-scan + +[Install] +WantedBy=default.target +EOF +} + configure() { [[ $ACTIVE_ != "yes" ]] && { @@ -36,35 +51,24 @@ configure() return 0 } - cat > /etc/systemd/system/nc-scan.timer <<EOF - [Unit] - Description=Timer to scan NC for externally modified files - - [Timer] - OnBootSec=${SCANINTERVAL_}min - OnUnitActiveSec=${SCANINTERVAL_}min - Unit=nc-scan.service - - [Install] - WantedBy=timers.target -EOF - cat > /etc/systemd/system/nc-scan.service <<EOF + cat > /etc/systemd/system/nc-scan.timer <<EOF [Unit] -Description=Scan NC for externally modified files +Description=Timer to scan NC for externally modified files -[Service] -Type=simple -ExecStart=/usr/local/bin/ncp-scan +[Timer] +OnBootSec=${SCANINTERVAL_}min +OnUnitActiveSec=${SCANINTERVAL_}min +Unit=nc-scan.service [Install] -WantedBy=default.target +WantedBy=timers.target EOF + systemctl daemon-reload systemctl enable nc-scan.timer systemctl start nc-scan.timer } -install() { :; } cleanup() { :; } # License |