diff --git a/Dockerfile b/Dockerfile index 36d6ec2..e168f5d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,9 +11,9 @@ FROM alpine:latest MAINTAINER "gitlab.com/pepa65 " RUN apk update && apk add bash php php-fpm ffmpeg tzdata file -ADD https://good4.eu/mailer /usr/bin/mailer +ADD https://good4.eu/mailer /usr/local/bin/mailer #ADD https://caddyserver.com/api/download?os=linux&arch=amd64&idempotency=74472262832423 /usr/bin/caddy -ADD https://good4.eu/caddy /usr/bin/caddy +ADD https://good4.eu/caddy /usr/local/bin/caddy COPY Caddyfile Dockerfile /root/ WORKDIR /var/www COPY encode init stream vars mailhash ./ diff --git a/README.md b/README.md index 049778f..485089a 100644 --- a/README.md +++ b/README.md @@ -59,14 +59,14 @@ Make the config file `/root/Caddyfile` like: #!/usr/bin/env bash # Make sure internet is reachable -while ! /usr/bin/ping -q -c 1 1.1.1.1 &>/dev/null +while ! ping -q -c 1 1.1.1.1 &>/dev/null do sleep 1 done cd /root /usr/local/bin/caddy stop &>/dev/null sleep 1 -/usr/bin/killall -9 caddy &>/dev/null +killall -9 caddy &>/dev/null /usr/local/bin/caddy start &>/root/caddy.log ``` and make it executable: `chmod +x /root/Caddy`. diff --git a/encode b/encode index 5314bf0..79a01c1 100755 --- a/encode +++ b/encode @@ -38,7 +38,7 @@ Mail(){ # 1:kind(0:done, 1:wrong type, 2:encoding error) 2:logline I:repopath,em msg[2]="Heya,\n\nThe file '$name' started encoding on $start but ran into an error on $finish.\n\nStream Upload server\n" if [[ $to && $user && $password && $smtp && $port ]] then # All ingredients for a mail present - mailer -m "$(echo -e "${msg[$1]}")" -t "$to" -s "${sbj[$1]}" -u "$user" -p "$password" -S "$smtp" -P "$port" -f "$from" 2>"$repopath/mailer.log" && + /usr/local/bin/mailer -m "$(echo -e "${msg[$1]}")" -t "$to" -s "${sbj[$1]}" -u "$user" -p "$password" -S "$smtp" -P "$port" -f "$from" 2>"$repopath/mailer.log" && Log "== Mail with subject '${sbj[$1]}' sent to $to" || Log "== Mail with subject '${sbj[$1]}' failed to send to: $to" Log "Start encoding on $start, finished on $finish" diff --git a/init b/init index 6b07df8..fc3fb16 100755 --- a/init +++ b/init @@ -20,9 +20,9 @@ sed -i "s/%sslmail%/$sslmail/" /root/Caddyfile [[ $interface ]] || interface=:80 sed -i "s/%interface%/$interface/" /root/Caddyfile -chmod +x /usr/bin/caddy /usr/bin/mailer +chmod +x /usr/local/bin/caddy /usr/local/bin/mailer php-fpm8 -R -caddy start --config /root/Caddyfile --adapter caddyfile >caddy.log +/usr/local/bin/caddy start --config /root/Caddyfile --adapter caddyfile >caddy.log sleep 9999d