如何从终端启用文件库

jar*_*ith 3 shell terminal osx-mavericks

我正在尝试编写一个脚本来使用 boxen 在新计算机上自动安装软件。有一个要求,即只有硬盘加密后,boxen 才会运行。我可以禁用它,但无论如何我想加密驱动器。有没有办法从终端执行此操作,以便我可以进一步简化流程?

che*_*ner 5

尝试一下该fdesetup工具:

NAME
     fdesetup -- FileVault enabling tool

SYNOPSIS
     fdesetup verb [options]

DESCRIPTION
     fdesetup is used to enable or disable FileVault, to list, add, or remove
     enabled FileVault users, and to obtain status about the current state of
     FileVault. Most commands require root access and need to be authenticated
     with either a FileVault password, a personal recovery key (if enabled),
     and in some cases the private key from the installed institutional recov-
     ery key.  Some status related commands can be run from a non-root ses-
     sion.

...
Run Code Online (Sandbox Code Playgroud)