Changed installation to use sudo and set perms

Defined paths into variables.
	Changed the way `sudo` is called and used.
	Change installation process to use sudo
	and to set owner and modes on files.
This commit is contained in:
Michael C Tiernan - MIT-Research Computing Project 2022-05-15 07:33:08 -04:00
parent 542c1616b8
commit ce9cd3a5bd

View file

@ -12,7 +12,7 @@ set -e
#when adding a tool to the list make sure to also add its corresponding command further in the script #when adding a tool to the list make sure to also add its corresponding command further in the script
unzip_tools_list=('unzip' '7z' 'busybox') unzip_tools_list=('unzip' '7z' 'busybox')
usage() { echo "Usage: sudo -v ; curl https://rclone.org/install.sh | sudo bash [-s beta]" 1>&2; exit 1; } usage() { echo "Usage: curl https://rclone.org/install.sh | sudo bash [-s beta]" 1>&2; exit 1; }
#check for beta flag #check for beta flag
if [ -n "$1" ] && [ "$1" != "beta" ]; then if [ -n "$1" ] && [ "$1" != "beta" ]; then
@ -172,16 +172,25 @@ case "$OS" in
makewhatis makewhatis
;; ;;
'osx') 'osx')
### - - - - - - - - - - - - - - - - - - - -
#binary #binary
mkdir -m 0555 -p ${binTgtDir} sudo -v
cp rclone ${binTgtDir}/rclone.new sudo -s -- <<-EOT
mv ${binTgtDir}/rclone.new ${binTgtDir}/rclone mkdir -m 0555 -p ${binTgtDir}
chmod a=x ${binTgtDir}/rclone cp rclone ${binTgtDir}/rclone.new
mv ${binTgtDir}/rclone.new ${binTgtDir}/rclone
chmod a=x ${binTgtDir}/rclone
EOT
### - - - - - - - - - - - - - - - - - - - -
#manual #manual
mkdir -m 0555 -p ${man1TgtDir} sudo -v
cp rclone.1 ${man1TgtDir} sudo -s -- <<-EOT
chmod a=r ${man1TgtDir}/rclone.1 mkdir -m 0555 -p ${man1TgtDir}
cp rclone.1 ${man1TgtDir}
chmod a=r ${man1TgtDir}/rclone.1
EOT
;; ;;
### - - - - - - - - - - - - - - - - - - - -
*) *)
echo 'OS not supported' echo 'OS not supported'
exit 2 exit 2