Skip to content

Commit 014bb63

Browse files
authored
fix syntax error in aria2c.sh (#230)
* fix syntax error in aria2c.sh * fix syntax error
1 parent fab6222 commit 014bb63

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

aria2c.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
#! /bin/bash -euo
1+
#! /bin/bash -eu
22

33
sed -i 's/6800/'"${ARIA2_EXTERNAL_PORT}"'/g' /usr/local/www/aria2/js/aria-ng*.js
44
RPC_SECRET_BASE64=$(echo -n ${RPC_SECRET} | base64)
55
sed -i 's/secret:\"\"/secret:\"'"${RPC_SECRET_BASE64}"'\"/g' /usr/local/www/aria2/js/aria-ng*.js
66

7-
if [ "$ARIA2_SSL" = "true" ]; then
7+
if [[ "${ARIA2_SSL}" = "true" ]]; then
88
echo "[INFO] Start aria2 with secure config and rpc-secret"
99

1010
/usr/bin/aria2c --conf-path="/app/conf/aria2.conf" \
@@ -13,15 +13,13 @@ if [ "$ARIA2_SSL" = "true" ]; then
1313
--rpc-private-key=/app/conf/key/aria2.key \
1414
--rpc-secret="${RPC_SECRET}" --rpc-secure
1515

16-
elif [ "$ARIA2_SSL" = "false" && ${RPC_SECRET} != "" ]; then
16+
elif [[ "${ARIA2_SSL}" = "false" ]] && [[ "${RPC_SECRET}" != "" ]]; then
1717
echo "[INFO] Start aria2 with rpc-secret"
1818
/usr/bin/aria2c --conf-path="/app/conf/aria2.conf" \
1919
--enable-rpc \
2020
--rpc-listen-all \
2121
--rpc-secret="${RPC_SECRET}"
22-
2322
else
24-
2523
echo "[INFO] Start aria2 with standard mode"
2624
/usr/bin/aria2c --conf-path="/app/conf/aria2.conf" --enable-rpc --rpc-listen-all
2725

0 commit comments

Comments
 (0)