Skip to content

Commit

Permalink
May fix substitution error
Browse files Browse the repository at this point in the history
  • Loading branch information
jaymoulin committed Dec 26, 2017
1 parent 7ede48a commit 352aa37
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION ?= 0.4.3
VERSION ?= 0.4.4
CACHE ?= --no-cache=1
FULLVERSION ?= ${VERSION}
archs ?= amd64 arm32v6 arm64v8 i386
Expand Down
12 changes: 2 additions & 10 deletions configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ if [ ! -f /opt/JDownloader/cfg/org.jdownloader.api.myjdownloader.MyJDownloaderSe
cp /opt/JDownloader/org.jdownloader.api.myjdownloader.MyJDownloaderSettings.json.dist /opt/JDownloader/cfg/org.jdownloader.api.myjdownloader.MyJDownloaderSettings.json
fi

if [ -f /opt/JDownloader/credentials ]; then
cred=$(cat /opt/JDownloader/cfg/credentials)
sed -i "s/\"password\" : \"${cred[1]}\",/\"password\" : \"$2\",/" /opt/JDownloader/cfg/org.jdownloader.api.myjdownloader.MyJDownloaderSettings.json && \
sed -i "s/\"email\" : \"${cred[0]}\"/\"email\" : \"$1\"/" /opt/JDownloader/cfg/org.jdownloader.api.myjdownloader.MyJDownloaderSettings.json
else
sed -i "s/\"password\" : null,/\"password\" : \"$2\",/" /opt/JDownloader/cfg/org.jdownloader.api.myjdownloader.MyJDownloaderSettings.json && \
sed -i "s/\"email\" : null/\"email\" : \"$1\"/" /opt/JDownloader/cfg/org.jdownloader.api.myjdownloader.MyJDownloaderSettings.json
fi

echo -e "$1\n$2" > /opt/JDownloader/credentials
sed -i "s/\"password\" : [^,]+/\"password\" : \"$2\"/" /opt/JDownloader/cfg/org.jdownloader.api.myjdownloader.MyJDownloaderSettings.json && \
sed -i "s/\"email\" : [^,]+/\"email\" : \"$1\"/" /opt/JDownloader/cfg/org.jdownloader.api.myjdownloader.MyJDownloaderSettings.json
pkill -f "JDownloader"

0 comments on commit 352aa37

Please sign in to comment.