Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
auto_login
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QG
auto_login
Commits
b9f379c1
Commit
b9f379c1
authored
Sep 11, 2017
by
孙 楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use iTerm
parent
9898e431
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
0 deletions
+65
-0
alogin
alogin
+2
-0
expectlogin.sh
expectlogin.sh
+8
-0
open.scpt
open.scpt
+55
-0
No files found.
alogin
View file @
b9f379c1
#!/usr/bin/env bash
#!/usr/bin/env bash
if
[
-n
"
$AUTO_LOGIN_HOME
"
]
;
then
if
[
-n
"
$AUTO_LOGIN_HOME
"
]
;
then
# sleep 2
.
"
$AUTO_LOGIN_HOME
/config"
.
"
$AUTO_LOGIN_HOME
/config"
token
=
$(
python
"
$AUTO_LOGIN_HOME
/onetimepass.py"
)
token
=
$(
python
"
$AUTO_LOGIN_HOME
/onetimepass.py"
)
# echo ${token}
expectlogin.sh
${
username
}
${
password
}
${
host
}
${
token
}
expectlogin.sh
${
username
}
${
password
}
${
host
}
${
token
}
else
else
echo
"AUTO_LOGIN_HOME not config"
echo
"AUTO_LOGIN_HOME not config"
...
...
expectlogin.sh
View file @
b9f379c1
#!/usr/bin/expect
#!/usr/bin/expect
#trap sigwinch spawned
trap
{
set
rows
[
stty
rows]
set
cols
[
stty
columns]
stty
rows
$rows
columns
$cols
<
$spawn_out
(
slave,name
)
}
WINCH
set
username
[
lindex
$argv
0]
set
username
[
lindex
$argv
0]
set
password
[
lindex
$argv
1]
set
password
[
lindex
$argv
1]
set
host
[
lindex
$argv
2]
set
host
[
lindex
$argv
2]
...
...
open.scpt
0 → 100755
View file @
b9f379c1
#!/usr/bin/osascript
# refrence http://www.carlosabalde.com/blog/2016/07/05/scripting-iterm2-using-applescript
set
commands
to
{
¬
{
¬
connection
:
"alogin"
,
¬
action
:
"tail -f /home/quant_group/logs/di-ting.log"
¬
},
¬
{
¬
connection
:
"alogin"
,
¬
action
:
"tail -f /home/quant_group/logs/di-ting.log"
¬
},
¬
{
¬
connection
:
"alogin"
,
¬
action
:
"tail -f /home/quant_group/logs/di-ting.log"
¬
}
¬
}
tell
application
"iTerm"
create
window
with
default
profile
# Create tab
-- tell current window
-- create tab with default profile
-- end tell
# Create sessions
# TODO for each
tell
current
session
of
current
window
set
num
to
count
of
commands
repeat
with
i
from
1
to
num
-
1
split
vertically
with
default
profile
end
repeat
end
tell
-- tell session 4 of current tab of current window
-- split horizontally with default profile
-- end tell
# Establish connections & execute actions.
repeat
with
i
from
1
to
count
of
commands
tell
session
i
of
current
tab
of
current
window
set
name
to
"SSH"
write
text
(
connection
of
item
i
of
commands
)
-- delay 1
-- write text (action of item i of commands)
end
tell
end
repeat
end
tell
-- osascript -e ''
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment