Skip to content
Snippets Groups Projects
Commit e5c63094 authored by efer's avatar efer
Browse files

polish macos post-install

parent f992d838
Branches
No related tags found
No related merge requests found
......@@ -685,25 +685,55 @@ echo -e "[backup script]" $G_"Installed"$_N
# macOS specific post-install
#
if [ $HOST_OS = 'Darwin' ]; then
echo -e $Y_"\nNOTE:"$_N "The setup will now prepare your Mac to show notifications from the backup script"
echo -e "as well as doing a first run of the backup script so you can grant access permissions manually\n"
echo -e $P_"\n########\n"$_N
echo -e $Y_"Prepare your Mac to show notifications from the backup script:\n"$_N
read -p $'Press Enter/Return to start the Script Editor - Please click the "Play" button to display a notification
Allow the Script Editor to show notifications in the Notification Center
Optionally click the "Play" button again to verify\n'
read -p $' * Press Enter/Return to start the Script Editor
* Follow the instructions there and return here when done\n'
echo 'display notifcation "Allow to show notifications from scripts"' > /tmp/notification.applescript
echo -e "#
# Please click the 'Play' button in the header bar above to trigger a notification
#
# Click the notification pop-up to open the Notification Settings window
#
# Allow the Script Editor to show notifications
#
# Optionally click the 'Play' button in the Script Editor again to verify
#
# Close the Script Editor and continue with the backup install script
# \n
" > /tmp/notification.applescript
echo 'display notification "Notifications from scripts working!"' >> /tmp/notification.applescript
open -a 'Script Editor' /tmp/notification.applescript
read -rp $'Please grant "rclone" access to Documents and Desktop folders when promted during the initial backup
Depending on how much data you already have, the initial backup can take a while
Do you want to run a backup now or postpone it for later? (y/n) [y] ' initialbackup
if [[ $initialbackup == "y" ]]; then
sleep 5
read -p $' * Press Enter/Return to continue\n'
echo -e $Y_"Grant folder access permissions:\n"$_N
echo -e "During the first run of the backup script some access needs to be allowed\n
Please grant" $G_"rclone"$_N "access to Desktop and Documents folders when promted\n
This can also be done manually in:"
echo "System Settings > Privacy & Security > Files & Folders"
echo -e "\nDepending on how much data you have, the first backup can take a while\n"
while true; do
read -p "Do you want to run a backup now or postpone it for later? (y/n) " initialbackup
case $initialbackup in
[Yy]* )
echo -e "[backup script]" $G_"Running..."$_N
launchctl load $UNIT_DIR/local.comp-backup.plist &>/dev/null
launchctl kickstart gui/$(id -u)/local.comp-backup
break
;;
[Nn]* )
echo -e $Y_"\nPlease make sure to allow folder access to rclone"$_N
break
;;
esac
done
echo -e $P_"\n########\n"$_N
fi
#
# Finish
#
echo -e "\nDTU Compute backup script can be started manually with the command: "$G_"comp-backup\n"$_N
echo -e "\nDTU Compute backup script can always be started manually with the command:"
echo -e $G_"comp-backup\n"$_N
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment