From 2f746426e70fb656c46b2f19172f4d02436d0a31 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 2 Feb 2018 13:23:58 +0000 Subject: [PATCH] install.sh: use `mv` to overwite an existing binary This stops the install process erroring with "Text file busy" when trying to `cp` over the binary. --- docs/content/install.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/content/install.sh b/docs/content/install.sh index 9557d583b..cb8fd5f39 100755 --- a/docs/content/install.sh +++ b/docs/content/install.sh @@ -137,9 +137,10 @@ cd $unzip_dir/* case $OS in 'linux') #binary - cp rclone /usr/bin/ - chmod 755 /usr/bin/rclone - chown root:root /usr/bin/rclone + cp rclone /usr/bin/rclone.new + chmod 755 /usr/bin/rclone.new + chown root:root /usr/bin/rclone.new + mv /usr/bin/rclone.new /usr/bin/rclone #manuals mkdir -p /usr/local/share/man/man1 cp rclone.1 /usr/local/share/man/man1/ @@ -147,9 +148,9 @@ case $OS in ;; 'freebsd'|'openbsd'|'netbsd') #bin - cp rclone /usr/bin/ - chmod 755 /usr/bin/rclone - chown root:wheel /usr/bin/rclone + cp rclone /usr/bin/rclone.new + chown root:wheel /usr/bin/rclone.new + mv /usr/bin/rclone.new /usr/bin/rclone #man mkdir -p /usr/local/man/man1 cp rclone.1 /usr/local/man/man1/ @@ -158,7 +159,8 @@ case $OS in 'osx') #binary mkdir -p /usr/local/bin - cp rclone /usr/local/bin/ + cp rclone /usr/local/bin/rclone.new + mv /usr/local/bin/rclone.new /usr/local/bin/rclone #manual mkdir -p /usr/local/share/man/man1 cp rclone.1 /usr/local/share/man/man1/