From 7a8ef8cab5235c7e85bc6deceb2d63ed9b809dd9 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Fri, 18 May 2018 01:30:06 +0900 Subject: [PATCH] Make the script idempotent --- btcpay-setup.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/btcpay-setup.sh b/btcpay-setup.sh index d73128f..d39462f 100755 --- a/btcpay-setup.sh +++ b/btcpay-setup.sh @@ -249,5 +249,14 @@ end script" > /etc/init/start_containers.conf fi -find "$ORIGINAL_DIRECTORY" -name "*.sh" -exec chmod +x {} \; -find "$ORIGINAL_DIRECTORY" -name "*.sh" -exec ln -s {} /usr/bin \; +cd $ORIGINAL_DIRECTORY + +for scriptname in *.sh; do + echo $scriptname + chmod +x $scriptname + if [ -e /usr/bin/$scriptname ]; then + rm /usr/bin/$scriptname + fi + ln -s $scriptname /usr/bin +done +