2019/10/26

Use administrator privileges with Touch ID from ShellScript / Terminal


From Terminal (sudo)

Add line auth sufficient pam_tid.so to /etc/pam.d/sudo
$ cat /etc/pam.d/sudo
auth       sufficient     pam_tid.so
auth       sufficient     pam_smartcard.so
auth       required       pam_opendirectory.so
account    required       pam_permit.so
password   required       pam_deny.so
session    required       pam_permit.so

ex.

$ sudo su

From ShellScript

Use osascript like followings..
osascript -e 'do shell script "Command or ShellScript" with administrator privileges'

ex.(using with heredocument)

$ osascript <<EOD
do shell script "whoami" with administrator privileges
EOD

2019/10/17

Changes in softwareupdate(8) (Catalina)


1.New feature fetch-full-installer


$ softwareupdate --fetch-full-installer --full-installer-version  xx.xx.xx
Downloading and installing xx.xx.xx installer
Installing: 14.0%
...



2.Response Format (label title is Added)


$ softwareupdate -l
Software Update Tool

Finding available software
Software Update found the following new or updated software:
* Label: macOS 10.15 Update- 
    Title: macOS 10.15 Update, Version: , Size: 962326K, Recommended: YES, Action: restart,





ref. softwareupdate(8) in catalina

% softwareupdate
usage: softwareupdate  [ ...]

** Manage Updates:
 -l | --list  List all appropriate update labels (options:  --no-scan, --product-types)
 -d | --download  Download Only
 -e | --cancel-download  Cancel a download
 -i | --install  Install
  
ref2.

——

$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.14.6
BuildVersion: 18G103

$ softwareupdate -l --include-config-data
Software Update Tool

Finding available software
Software Update found the following new or updated software:
   * Safari13.0.3MojaveAuto-13.0.3
 Safari (13.0.3), 67268K [recommended]

$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.14.6
BuildVersion: 18G103

$ softwareupdate -l --include-config-data
Software Update Tool

Finding available software
Software Update found the following new or updated software:
   * Security Update 2019-001-10.14.6
 Security Update 2019-001 (10.14.6), 1285122K [recommended] [restart]
   * XProtectPlistConfigData_10_14-2107
 XProtectPlistConfigData (2107), 68K [recommended]


——
% sw_vers
ProductName: Mac OS X
ProductVersion: 10.15
BuildVersion: 19A602

% softwareupdate -l --include-config-data
Software Update Tool

Finding available software
Software Update found the following new or updated software:
* Label: AppleKextExcludeList_10_15-15.1.1
 Title: Incompatible Kernel Extension Configuration Data, Version: 15.1.1, Size: 1028K, Recommended: YES,
* Label: macOS 10.15.1 Update-
 Title: macOS 10.15.1 Update, Version:  , Size: 4787879K, Recommended: YES, Action: restart,
* Label: XProtectPlistConfigData_10_15-2107
 Title: XProtectPlistConfigData, Version: 2107, Size: 68K, Recommended: YES,

% sw_vers
ProductName: Mac OS X
ProductVersion: 10.15.1
BuildVersion: 19B88

% softwareupdate -l --include-config-data
Software Update Tool

Finding available software
Software Update found the following new or updated software:
* Label: GatekeeperCompatibilityData-1.0
 Title: Gatekeeper Compatibility Data, Version: 1.0, Size: 7108K, Recommended: YES, 
%