diff --git a/macos/install.sh b/macos/install.sh index 97fae28..532dd98 100755 --- a/macos/install.sh +++ b/macos/install.sh @@ -6,13 +6,16 @@ ROOT_DIR=$(dirname "$SCRIPT_DIR") $ROOT_DIR/set_up_common.sh -mkdir -p "$HOME/Library/Keyboard Layouts/" -cp "/Users/jedrzej/Library/Mobile Documents/com~apple~CloudDocs/Random/Keyboard Layouts/Polish-German.bundle" "$HOME/Library/Keyboard Layouts/" -echo "Reboot and add the Polish-German keyboard layout from Polish keyboards" -cp ROOT_DIR/dotfiles_private/fonts/* ~/Library/Fonts/ +KEYBOARD_SOURCE_PATH="$HOME/Library/Mobile Documents/com~apple~CloudDocs/Random/Keyboard Layouts/Polish-German.bundle" +KEYBOARD_TARGET_PATH="$HOME/Library/Keyboard Layouts/Polish-German.bundle" +if [ -e "$KEYBOARD_SOURCE_PATH" ] && [ ! -e $KEYBOARD_TARGET_PATH ]; then + cp "$KEYBOARD_SOURCE_PATH" "$KEYBOARD_TARGET_PATH" + echo "Reboot and add the Polish-German keyboard layout from Polish keyboards" +fi +cp $ROOT_DIR/dotfiles_private/fonts/* ~/Library/Fonts/ SSH_CONFIG_PATH=/etc/ssh/sshd_config.d/100-macos.conf if ! grep -Fxq "PasswordAuthentication no" "$SSH_CONFIG_PATH"; then - echo "PasswordAuthentication no" >> "$SSH_CONFIG_PATH" - echo "ChallengeResponseAuthentication no" >> "$SSH_CONFIG_PATH" + sudo bash -c 'echo "PasswordAuthentication no" >> "$SSH_CONFIG_PATH"' + sudo bash -c 'echo "ChallengeResponseAuthentication no" >> "$SSH_CONFIG_PATH"' fi