From 82433ae508e02bcede6215af338f67c22bb81dbf Mon Sep 17 00:00:00 2001 From: Joss Brown Date: Thu, 16 Jun 2016 19:54:50 +0200 Subject: [PATCH] 141 interim --- README.md | 3 ++- minisign-sign.sh | 16 +++++++++++++--- minisign-verify.sh | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index fabb365..d2ec2e0 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,8 @@ Only necessary if for some reason you want to run this from the shell or another * My own minisign public key for releases on Github will be created in `${HOME}/Documents/minisign` ## To-do -* Switch private keys directory to `${HOME}/.minisign` (depending on minisign update) +- [ ] Notification if update is available +- [ ] Switch private keys directory to `${HOME}/.minisign` (pending `minisign` update) ## Screengrabs ### Signing diff --git a/minisign-sign.sh b/minisign-sign.sh index 4f155ee..3dc244a 100755 --- a/minisign-sign.sh +++ b/minisign-sign.sh @@ -1,11 +1,21 @@ #!/bin/bash -# minisign-sign v1.4 (shell script version) +# minisign-sign v1.4.1 (shell script version) LANG=en_US.UTF-8 export PATH=/usr/local/bin:$PATH ACCOUNT=$(who am i | /usr/bin/awk '{print $1}') +# determine correct Mac OS name +MACOS2NO=$(/usr/bin/sw_vers -productVersion | /usr/bin/awk -F. '{print $2}') +if [[ "$MACOS2NO" -le 7 ]] ; then + OSNAME="Mac OS X" +elif [[ "$MACOS2NO" -ge 8 ]] && [[ "$MACOS2NO" -le 11 ]] ; then + OSNAME="OS X" +elif [[ "$MACOS2NO" -ge 12 ]] ; then + OSNAME="macOS" +fi + # set notification function notify () { if [[ "$NOTESTATUS" == "osa" ]] ; then @@ -146,7 +156,7 @@ EOT) tell application "System Events" activate set theLogoPath to ((path to library folder from user domain) as text) & "Caches:local.lcars.minisign:lcars.png" - set thePassword to text returned of (display dialog "Enter the password for the new secret key. It will be stored in your macOS keychain." ¬ + set thePassword to text returned of (display dialog "Enter the password for the new secret key. It will be stored in your " & "$OSNAME" & " keychain." ¬ default answer "" ¬ with hidden answer ¬ buttons {"Cancel", "Enter"} ¬ @@ -223,7 +233,7 @@ EOT) tell application "System Events" activate set theLogoPath to ((path to library folder from user domain) as text) & "Caches:local.lcars.minisign:lcars.png" - set thePassword to text returned of (display dialog "There is no password stored in your macOS keychain for this secret key. Enter the password you chose when you created this key." ¬ + set thePassword to text returned of (display dialog "There is no password stored in your " & "$OSNAME" & " keychain for this secret key. Enter the password you chose when you created this key." ¬ default answer "" ¬ with hidden answer ¬ buttons {"Cancel", "Enter"} ¬ diff --git a/minisign-verify.sh b/minisign-verify.sh index 1fcf948..6dc1b72 100755 --- a/minisign-verify.sh +++ b/minisign-verify.sh @@ -1,6 +1,6 @@ #!/bin/bash -# minisign-verify v1.4 (shell script version) +# minisign-verify v1.4.1 (shell script version) LANG=en_US.UTF-8 export PATH=/usr/local/bin:$PATH