Timur Sufiev 0382648b5b Cherry-pick the following commit from release-0.3:
* Resolve issues with SQLCluster
  Ic2f5f1763472f13aeab63ef8919a437837d76b2f
* Resolve issue with SQLCluster clusterIp property
  I2103edf9702b51472c32a3e5e789421fa1167c13
* Resolve issue with SQLServer
  Fixed bug #1245835
  Id1adb038926f244ffbed6339a3aa1eb8387f29a5
* Linux+Apache support added, small fixes done
  I15db406d75e6e47ac2a7ffeb1e84da4a814d49f3
* Fixed linux workflow,templates and shell scripts
  Ie5ab1bc824dba07771d94686af63f939ab05d5ca
* Remove send-command from Demo.xml
  I48a2ab0995c96c255c9dc95d84937427ae0b6194
* Changed config path and xinet dist based exec
  Ic03a540526e5807a43d07b70f901ce04dc5615f9
* Fixed FW saving rules on reboot for CentOS
  Iba4dbd4f5924f16dc6f5b547663157da189793c3

Change-Id: Iba4dbd4f5924f16dc6f5b547663157da189793c3
2013-12-05 15:54:16 +04:00

68 lines
1.4 KiB
Bash

#!/bin/bash
#
function include(){
curr_dir=$(cd $(dirname "$0") && pwd)
inc_file_path=$curr_dir/$1
if [ -f "$inc_file_path" ]; then
. $inc_file_path
else
echo -e "$inc_file_path not found!"
exit 1
fi
}
include "common.sh"
# FirewallRules
FW_RULE1='-I INPUT 1 -p tcp -m tcp --dport 23 -j ACCEPT -m comment --comment "by murano, Telnet server access on port 23"'
APP=''
XINIT_CFG=0
get_os
[[ $? -ne 0 ]] && exit 1
case $DistroBasedOn in
"debian")
APP="telnetd"
;;
"redhat")
APP="telnet-server"
XINIT_CFG=1
;;
esac
APPS_TO_INSTALL="$APP"
bash installer.sh -p sys -i $APPS_TO_INSTALL
if [ $XINIT_CFG -gt 0 ]; then
xinetd_tlnt_cfg="/etc/xinetd.d/telnet"
if [ -f "$xinetd_tlnt_cfg" ]; then
sed -i '/disable.*=/ s/yes/no/' $xinetd_tlnt_cfg
if [ $? -ne 0 ]; then
log "can't modify $xinetd_tlnt_cfg"
exit 1
fi
else
log "$APP startup config not found under $xinetd_tlnt_cfg"
fi
#security tty for telnet
setty=/etc/securetty
lines=$(sed -ne '/^pts\/[0-9]/,/^pts\/[0-9]/ =' $setty)
if [ -z "$lines" ]; then
cat >> $setty << "EOF"
pts/0
pts/1
pts/2
pts/3
pts/4
pts/5
pts/6
pts/7
pts/8
pts/9
EOF
if [ $? -ne 0 ]; then
log "Error occured during $setty changing..."
exit 1
fi
else
echo "$setty has pts/0-9 options..."
fi
restart_service xinetd
fi
add_fw_rule $FW_RULE1