Download and insert salt string inside wordpress wp-config.php with Bash

前端 未结 10 2273
有刺的猬
有刺的猬 2021-02-13 06:27

How can I insert the content of the variable $SALT in a specific point (line or string) of a file like wp-contet.php from wordpress using Bash script?



        
10条回答
  •  隐瞒了意图╮
    2021-02-13 06:46

    I built a simple CLI for just that. Try it out. It's called [WP-Salts-Update-CLI][1].

    WP-Salts-Update-CLI

    WPSUCLI downloads new salts from the WP API and replaces them with the ones in your wp-config.php file for every site on your server.

    ⚡️ Installation

    Open command line terminal (I prefer iTerm2) and run the following command.

    bash sudo wget -qO wpsucli https://git.io/vykgu && sudo chmod +x ./wpsucli && sudo install ./wpsucli /usr/local/bin/wpsucli

    This command will perform the following actions:

    • Use sudo permissions
    • Use wget to download WPSUCLI and rename it to wpsucli
    • Make the wpsucli executable
    • Install wpsucli inside /usr/local/bin/ folder.

提交回复
热议问题