본문 바로가기
Server&OS/Linux

SecureCRT Logon Script Sample / vi한글깨짐방지

by 백룡화검 2010. 11. 25.

-한글깨짐방지 :

/etc/sysconfig/i18n 여기에 아래내용 삽입 하면 끝~
LANG="ko_KR.eucKR"
SUPPORTED="en_US.iso885915:en_US:en:ko_KR.eucKR:ko_KR:ko"
SYSFONT="lat0-sun16"
SYSFONTACM="iso15"

[참고]
LANG="ko_KR.UTF-8" 부분이 존재할경우 해당 부분을 주석처리 해야 한다.

수정하고 나서는 bash로 변경부분을 적용해 준다.
# bash

 

-로그온 스크립트 샘플

~~~~~~~~~~~~~~~~~~~~ Begin MultiSessionLogin.vbs ~~~~~~~~~~~~~~~~~~~~~~~~~~

#$language = "VBScript"
#$interface = "1.0"

' script for logging in to multiple servers

Sub main

' turn on synchronous mode
crt.Screen.Synchronous = True

' login name
crt.Screen.WaitForString "ogin:"
crt.Screen.Send "userid" & VbCr

' password
crt.Screen.WaitForString "assword:"
crt.Screen.Send "passwd" & VbCr

' find machine name
crt.Screen.WaitForString "$ "
crt.Screen.Send "uname -n" & VbCr
crt.Screen.WaitForString "$ "
row = crt.Screen.CurrentRow -1
mach = Trim(crt.Screen.Get(row,1,row,20))

' decide if more commands are needed
Select Case mach
Case "bldsrv9"
crt.Screen.Send "cd blddir" & VbCr
crt.Screen.WaitForString "$ "
crt.Screen.Send ". ./.bldprof9" & VbCr
crt.Screen.WaitForString "$ "
crt.Screen.Send "cd $MYNODE" & VbCr
Case "bldsrv10","bldsrv11"
crt.Screen.Send "cd blddir" & VbCr
crt.Screen.WaitForString "$ "
crt.Screen.Send ". ./.bldprof10" & VbCr
crt.Screen.WaitForString "$ "
crt.Screen.Send "cd $MYNODE" & VbCr
End Select

' setup the test servers (names start with tstsrv)
If Left(mach,6) = "tstsrv" Then
crt.Screen.Send ". ./.tstprofile" & VbCr
crt.Screen.WaitForString "$ "
End If

' turn off synchronous mode
crt.Screen.Synchronous = False

End Sub

'~~~~~~~~~~~~~~~~~~~~ MultiSessionLogin.vbs ~~~~~~~~~~~~~~~~~~~~~~~~~~

 

http://www.vandyke.com/support/tips/loginscript.html

 

 

●Cisco Switch Auto Logon Script

- 빨간색 부분만 패스워드로 바꿔주면 됨! (파일명은 .vbs)

 

#$language = "VBScript"
#$interface = "1.0"

' script for logging in to multiple servers

Sub main

' turn on synchronous mode
crt.Screen.Synchronous = True

' login name
crt.Screen.WaitForString "Username:"
crt.Screen.Send "xxxxxx" & VbCr

' password
crt.Screen.WaitForString "assword:"
crt.Screen.Send "xxxxxx" & VbCr

' enable
crt.Screen.WaitForString ">"
crt.Screen.Send "enable" & VbCr

' enable password
crt.Screen.WaitForString "assword:"
crt.Screen.Send "xxxxxx" & VbCr

' turn off synchronous mode
crt.Screen.Synchronous = False

End Sub