new component - upload to NAS
This commit is contained in:
9
nas_sync/Dockerfile
Normal file
9
nas_sync/Dockerfile
Normal file
@@ -0,0 +1,9 @@
|
||||
FROM bash:latest
|
||||
# alpine with bash instead of sh
|
||||
|
||||
RUN apk add lsyncd cifs-utils
|
||||
RUN mkdir -p /sync/remote_files
|
||||
COPY entrypoint.sh /sync/entrypoint.sh
|
||||
|
||||
|
||||
ENTRYPOINT ["bash", "/sync/entrypoint.sh"]
|
10
nas_sync/entrypoint.sh
Normal file
10
nas_sync/entrypoint.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
sleep 5 # waits for the vpn to have an established connection
|
||||
echo "Starting NAS sync"
|
||||
mount -t cifs "//$1" -o credentials=/sync/nas_login.config /sync/remote_files
|
||||
echo "Successfully mounted SAMBA remote: $1 --> /sync/remote_files"
|
||||
shift # consumes the variable set in $1 so tat $@ only contains the remaining arguments
|
||||
|
||||
exec "$@"
|
Reference in New Issue
Block a user