For 'Mac OSX' Force ownership and modes on file using sudo.

Avoid assuming certain things.
	Forcing creation of target dir with correct mode and ownership.
	Move files into place setting their modes too.
	These tasks done the same for binary and manpages.
This commit is contained in:
Michael C Tiernan - MIT-Research Computing Project 2022-05-19 07:51:15 -04:00
parent dd0075735d
commit 1f114d504b

View file

@ -175,20 +175,19 @@ case "$OS" in
### - - - - - - - - - - - - - - - - - - - -
#binary
sudo -v
sudo -s -- <<-EOT
mkdir -m 0555 -p ${binTgtDir}
cp rclone ${binTgtDir}/rclone.new
mv ${binTgtDir}/rclone.new ${binTgtDir}/rclone
chmod a=x ${binTgtDir}/rclone
EOT
sudo -u root -- bash -c "\
mkdir -m 0755 -p ${binTgtDir} && \
cp rclone ${binTgtDir}/rclone.new && \
mv ${binTgtDir}/rclone.new ${binTgtDir}/rclone && \
chmod a=x ${binTgtDir}/rclone && \
chown root:root ${binTgtDir}/rclone"
### - - - - - - - - - - - - - - - - - - - -
#manual
sudo -v
sudo -s -- <<-EOT
mkdir -m 0555 -p ${man1TgtDir}
cp rclone.1 ${man1TgtDir}
chmod a=r ${man1TgtDir}/rclone.1
EOT
sudo -u root -- bash -c "\
mkdir -m 0555 -p ${man1TgtDir} && \
cp rclone.1 ${man1TgtDir} && \
chmod a=r ${man1TgtDir}/rclone.1"
;;
### - - - - - - - - - - - - - - - - - - - -
*)