首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >集装箱内码头卷曲插座

集装箱内码头卷曲插座
EN

Stack Overflow用户
提问于 2018-05-03 11:37:27
回答 1查看 1.1K关注 0票数 1

我有一个用于rtorrent的bash后处理脚本。在它中,我尝试创建一个容器,启动它,最后删除它。所有这些都是通过curl命令传递到我安装到容器中的坞插座。该命令从rtorrent成功执行。pushover的curl命令运行得很好。

但是我得到了一个curl:(7)无法连接到停靠器curl命令的服务器错误消息。

希望有人能给我指明正确的方向。

日志:

代码语言:javascript
复制
^@
---
^@/usr/local/bin/rtorrent-postprocess.sh /Pathtothedownload Nameofthedownload label
---
^@{"status":1,"request":"ec5c3c9c-5744-48f4-909b-68d38ec5e659"}curl: (7) Couldn't connect to server
curl: (7) Couldn't connect to server
curl: (7) Couldn't connect to server
curl: (7) Couldn't connect to server

--- Success ---

脚本:

代码语言:javascript
复制
#!/bin/bash
# rtorrent postprocess Script by Tobias
export LANG=de_DE.UTF-8

# The file for logging events from this script
LOGFILE="/config/rtorrent-postprocess.log"
#LOGFILE="./debug.log"

# Pfad des Downloads
FOLDER="$1"

# Name des Downloads
NAME="$2"

# Label des Downloads
LABEL="$3"

# Media Verzeichniss /data/Media
MEDIA="/data/Media"

# COMPLETE Verzeichniss mit label /data/torrent/completed/$3
COMPLETE="/data/torrent/completed/$3"

##############################################################################

function edate
{
  echo "`date '+%Y-%m-%d %H:%M:%S'`    $1" >> "$LOGFILE"
}

function pushover {
  curl -s \
    -F "token=xxxxxxxxxxxxxxxx" \
    -F "user=xxxxxxxxxxxxxxxxx" \
    -F "message=$1 finished $2 $3 on `date +%d.%m.%y-%H:%m`" \
    https://api.pushover.net/1/messages.json
}

edate " "
edate "Verzeichniss ist $COMPLETE"
edate "Name ist $NAME"
edate "Label ist $LABEL"
edate "rtorrent finished downloading $NAME"

pushover "rtorrent" "downloading" "$NAME"

edate "Starte Filebot - $COMPLETE/$NAME"

test_command() {
        curl --unix-socket /var/run/docker.sock -X POST "http://localhost/containers/${NAME}/wait" -H "accept: application/json"
}

curl --unix-socket /var/run/docker.sock -H "Content-Type: application/json" -d '{ "Image": "rednoah/filebot", "Cmd": ["-script", "fn:amc", "--output", "/Media", "--action", "move", "-non-strict", "/volume1", "--log-file", "/opt/rtorrentvpn/config/filebot.log", "--conflict", "auto", "--def", "artwork=n", "seriesFormat=Serien/{localize.eng.n}/Season {s.pad(2)}/{localize.eng.n} - {s00e00} - {localize.deu.t}", "movieFormat=Filme/{localize.deu.n} ({y})/{localize.deu.n} ({y})", "musicFormat=Musik/{artist}/{album}/{fn}"], "HostConfig": { "Binds": ["'$COMPLETE/$NAME':/volume1", "data:/data", "/data/Media:/Media"]} }' "http://localhost/containers/create?name=${NAME}"

curl --unix-socket /var/run/docker.sock -X POST "http://localhost/containers/${NAME}/start" -H "accept: application/json"

if [ "$(test_command)" == "200" ]; then
    edate "Status ist $test_command"
fi

curl --unix-socket /var/run/docker.sock -X DELETE "http://localhost/containers/${NAME}?force=true?v=true" -H "accept: application/json"

edate " "
edate "Filebot fertig"
EN

回答 1

Stack Overflow用户

发布于 2018-05-04 06:18:42

我将PUID和GUID更改为根id。多亏了Robin479comment,现在一切都如期而至。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50154153

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档