-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun.sh
More file actions
28 lines (24 loc) · 1.21 KB
/
run.sh
File metadata and controls
28 lines (24 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
set -e
# check if we should trust selfsigned certificates
if [ "$TRUST_SELFSIGN" -eq 1 ]; then
echo "[INFO] TRUST_SELFSIGN is set to $TRUST_SELFSIGN, setting run parameter '--trust'" | ts '%Y-%m-%d %H:%M:%.S'
SELFSIGN="--trust"
fi
# check if we should sync hidden files
if [ "$SYNC_HIDDEN" -eq 1 ]; then
echo "[INFO] SYNC_HIDDEN is set to $SYNC_HIDDEN, setting run parameter '-h'" | ts '%Y-%m-%d %H:%M:%.S'
SYNCHIDDEN='-h'
fi
# check if we should silence output
if [ "$SILENCE_OUTPUT" -eq 1 ]; then
echo "[INFO] SILENCE_OUTPUT is set to $SILENCE_OUTPUT, setting run parameter '--silent'" | ts '%Y-%m-%d %H:%M:%.S'
SILENCEOUTPUT='--silent'
fi
echo "[INFO] Running nextcloudcmd as following:" | ts '%Y-%m-%d %H:%M:%.S'
echo "[INFO] nextcloudcmd $SELFSIGN $SYNCHIDDEN $SILENCEOUTPUT -n --non-interactive /nextclouddata $NEXTCLOUD_PROTO://$NEXTCLOUD_SERVER$NEXTCLOUD_URLPATH$NEXTCLOUD_WEBDAV$NEXTCLOUD_FILEPATH" | ts '%Y-%m-%d %H:%M:%.S'
while true
do
su - nextcloudclient -c "nextcloudcmd $SELFSIGN $SYNCHIDDEN $SILENCEOUTPUT -n --non-interactive /nextclouddata $NEXTCLOUD_PROTO://$NEXTCLOUD_SERVER$NEXTCLOUD_URLPATH$NEXTCLOUD_WEBDAV$NEXTCLOUD_FILEPATH &> /opt/Nextcloud/log/latest.log"
sleep $RUN_INTERVAL
done