Last active
December 7, 2019 15:52
-
-
Save ysaotome/f5a2b0e5babda027d990 to your computer and use it in GitHub Desktop.
ニフティクラウドのCLIツール( http://cloud.nifty.com/api/cli/ )を自動セットアップするスクリプトと使用例
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# setup NIFTY Cloud API Tools | |
( | |
USER=${USER} | |
HOME=${HOME} | |
ARC=$(/bin/uname -m) | |
## OpenJDKセットアップ | |
/usr/bin/yum -y install java-1.6.0-openjdk.${ARC} | |
## NIFTY Cloud API Tools の設定 | |
/usr/bin/wget -P ${HOME} 'http://cloud.nifty.com/api/sdk/NIFTY_Cloud_api-tools.zip' | |
/usr/bin/unzip -d ${HOME} ${HOME}/NIFTY_Cloud_api-tools.zip | |
/bin/rm -rf ${HOME}/NIFTY_Cloud_api-tools.zip | |
/bin/rm -rf ${HOME}/NIFTY_Cloud_api-tools/bin/*.cmd | |
/bin/chown -R ${USER}:${USER} ${HOME}/NIFTY_Cloud_api-tools/ | |
/bin/chmod 755 ${HOME}/NIFTY_Cloud_api-tools/bin/* | |
/bin/cat << _NCSSCONF_ >> ${HOME}/.bashrc | |
## NIFTY Cloud API Settings | |
export NIFTY_CLOUD_HOME=${HOME}/NIFTY_Cloud_api-tools/ | |
export PATH=\${PATH}:\${NIFTY_CLOUD_HOME}/bin | |
export JAVA_HOME=/usr/lib/jvm/jre | |
export JAVA_OPTS=-Duser.language=ja | |
_NCSSCONF_ | |
source ${HOME}/.bashrc | |
) 2>&1 | /usr/bin/tee /var/log/niftycloud-api-tools-installer.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
今のバージョンだと .bashrc に下記を追記する必要がありました。
export NIFTY_CLOUD_URL=https://west-1.cp.cloud.nifty.com/api/
これをしないと
org.apache.http.client.ClientProtocolException: URI does not specify a valid host name
エラーが発生します。また、URL は http://cloud.nifty.com/api/endpoint.htm を参考に、使っているリージョンと同じものを指定する必要があります。