diff --git a/Dockerfile b/Dockerfile index 7af3508..3880dd0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ EXPOSE 80 139 445 WORKDIR / COPY Service-check.sh . RUN apt-get update && apt-get upgrade -y -RUN apt-get install apt-transport-https wget samba samba-common unison -y && \ +RUN apt-get install apt-transport-https wget samba samba-common -y && \ mkdir /media/storage /data /data/samba /data/webmin VOLUME /data @@ -26,4 +26,7 @@ RUN sed -i 's/10000/80/g' /etc/webmin/miniserv.conf && \ sed -i 's/ssl=1/ssl=0/g' /etc/webmin/miniserv.conf RUN echo root:webmin | chpasswd + +RUN cp /etc/samba/* /data/samba/. && cp /etc/webmin/* /data/webmin/. + CMD [ "/bin/bash","/Service-check.sh" ] diff --git a/Service-check.sh b/Service-check.sh index 32b3a7e..6276a64 100644 --- a/Service-check.sh +++ b/Service-check.sh @@ -1,8 +1,12 @@ #!/bin/bash -unison -batch /etc/samba /data/samba -unison -batch /etc/webmin /data/webmin apt-get update && apt-get upgrade -y wait +if [ ! -f /data/webmin/config ]; +then +cp /etc/samba/* /data/samba/. && cp /etc/webmin/* /data/webmin/. +fi +wait +ln -f /data/samba/* /etc/samba/ && ln -f /etc/webmin/* /data/webmin/ service webmin start service smbd start service nmbd start