0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

force cli : login用の便利ツール

Posted at

初めに

本番環境、各種Sandoboxに接続しながら作業している時に簡単にloginできるようにシェルを作りました。その時の備忘録です。

通常は、以下のようにユーザIdを指定してloginします。毎回ユーザIdを入力するのが少々面倒です。

$force login -u=admin@xxxxxx.co.jp -p=xxxxxx

今回もシェルを使います

$cat fclogin.sh 

# !/bin/sh$
# force cli へのログイン$

tmp=/tmp/tmp-$$
myInput=$1
cat << FIN > $tmp-in
$myInput 1
FIN$

cat $tmp-in |
awk '$1 == "main"{$2=1}
     $1 == "dev" {$2=2}
     $1 == "demo"{$2=3}
     $1 == "par" {$2=4}
                 {print $0}'|
cat > $tmp-select

cat $tmp-select |
awk '{print $2}' |
cat > $tmp-select2
sw=`echo | cat $tmp-select2`

## login 本番環境、開発環境
if [ $sw -eq 1 ]
then
force login -u=admin@xxxxxx.co.jp -p=xxxxxx
fi

## login sandbox
if [ $sw -eq 2 ]
then
force -i=test login -u=admin@xxxxxx.co.jp.dev -p=xxxxxx
fi

終了処理$
rm -f $tmp-*
exit 0

# 使い方
本番環境
$fclogin.sh main

sandbox
$fclogin.sh dev

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?