Update 'root/usr/libexec/apps/btcpayserver/btcpayserver.sh'

main
ben 1 year ago
parent 8d859e2403
commit 4dbb63cebe

@ -4,13 +4,13 @@ ACTION=${1}
shift 1 shift 1
get_image() { get_image() {
local IMAGE_NAME=$(uci get btcpayserver.@btcpayserver[0].image_name 2>/dev/null) IMAGE_NAME=$(uci get btcpayserver.@btcpayserver[0].image_name 2>/dev/null)
} }
do_install_detail() { do_install_detail() {
local config=$(uci get btcpayserver.@btcpayserver[0].config_path 2>/dev/null) config=$(uci get btcpayserver.@btcpayserver[0].config_path 2>/dev/null)
local port=$(uci get btcpayserver.@btcpayserver[0].port 2>/dev/null) port=$(uci get btcpayserver.@btcpayserver[0].port 2>/dev/null)
local IMAGE_NAME=$(uci get btcpayserver.@btcpayserver[0].image_name 2>/dev/null) IMAGE_NAME=$(uci get btcpayserver.@btcpayserver[0].image_name 2>/dev/null)
GEN_PASS=$(head -c14 /dev/urandom | tr -dc A-Za-z0-9) GEN_PASS=$(head -c14 /dev/urandom | tr -dc A-Za-z0-9)
GEN_PASS2=$(head -c14 /dev/urandom | tr -dc A-Za-z0-9) GEN_PASS2=$(head -c14 /dev/urandom | tr -dc A-Za-z0-9)
@ -21,6 +21,7 @@ do_install_detail() {
[ -z "$config" ] && { echo "config path is empty!"; exit 1; } [ -z "$config" ] && { echo "config path is empty!"; exit 1; }
[ -z "$port" ] && port=8888 [ -z "$port" ] && port=8888
[ -z "$IMAGE_NAME" ] && IMAGE_NAME=clightning [ -z "$IMAGE_NAME" ] && IMAGE_NAME=clightning
}
setup_btcpayserver() { setup_btcpayserver() {
git clone https://github.com/btcpayserver/btcpayserver-docker /opt/docker2/compose/btcpayserver/btcpayserver-docker/ git clone https://github.com/btcpayserver/btcpayserver-docker /opt/docker2/compose/btcpayserver/btcpayserver-docker/
@ -46,19 +47,18 @@ setup_btcpayserver() {
EOF EOF
} }
if [ "\$(id -u)" -ne 0 ]; then if [ "$(id -u)" -ne 0 ]; then
echo "This script must be run as root." echo "This script must be run as root."
exit 1 exit 1
fi fi
setup_btcpayserver setup_btcpayserver
EOF
chmod +x /opt/docker2/compose/btcpayserver/btcpayserver-docker/go.sh chmod +x /opt/docker2/compose/btcpayserver/btcpayserver-docker/go.sh
echo "Please open a terminal window and login via SSH to $LAN_IP" echo "Please open a terminal window and login via SSH to $LAN_IP"
echo "Copy paste the commands to finish the BTCpay server Install" echo "Copy paste the commands to finish the BTCpay server Install"
echo ".................Enter commands below......................" echo ".................Enter commands below......................"
echo "cd /opt/docker2/compose/btcpayserver/btcpayserver-docker" echo "cd /opt/docker2/compose/btcpayserver/btcpayserver-docker"
echo ". ./go.sh -i echo ". ./go.sh -i"
echo "..........................................................." echo "..........................................................."
uci add shortcutmenu lists uci add shortcutmenu lists
@ -66,7 +66,6 @@ EOF
uci set shortcutmenu.@lists[-1].weburl="$LAN_IP:$port" uci set shortcutmenu.@lists[-1].weburl="$LAN_IP:$port"
uci set shortcutmenu.@lists[-1].webpath="/" uci set shortcutmenu.@lists[-1].webpath="/"
uci commit shortcutmenu uci commit shortcutmenu
}
usage() { usage() {
echo "usage: $0 sub-command" echo "usage: $0 sub-command"
@ -104,4 +103,3 @@ case "${ACTION}" in
exit 1 exit 1
;; ;;
esac esac

Loading…
Cancel
Save