-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconsole.sh
executable file
·40 lines (34 loc) · 1.45 KB
/
console.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
#**********************************************************
#* CATEGORY APPLICATIONS
#* GROUP MAINFRAME
#* AUTHOR LANCE HAYNIE <[email protected]>
#* DATE 2015-08-28
#* PURPOSE CONSOLE STARTUP & NETWORKING
#**********************************************************
#* MODIFICATIONS
#* 2015-08-28 - LHAYNIE - INITIAL VERSION
#**********************************************************
#**********************************************************
# GLOBAL VARIABLES/INCLUDES/MISC
#**********************************************************
source conf/config.cfg
pid=$$
echo $pid > /tmp/mainframeconsole.pid
#**********************************************************
# MAIN PROGRAM
#**********************************************************
clear
#Do some networking stuff
echo "1" > /proc/sys/net/ipv4/ip_forward
echo "1" > /proc/sys/net/ipv4/conf/eth0/proxy_arp
echo "1" > /proc/sys/net/ipv4/conf/tun1/proxy_arp
echo "1" > /proc/sys/net/ipv4/conf/tun2/proxy_arp
echo "1" > /proc/sys/net/ipv4/conf/tun3/proxy_arp
echo "1" > /proc/sys/net/ipv4/conf/tun4/proxy_arp
#Add the route so you can access your mainframe
ip route add $mainframeip via $tunnelip >/dev/null 2>&1
#Start a 3270 session to the console
c3270 $hostserver:$consoleport
rm -f /tmp/mainframeconsole.pid
exit 1