Ai
1 Star 0 Fork 0

子安/ShellScripts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
putefc02 1.96 KB
一键复制 编辑 原始数据 按行查看 历史
Agapito Rojas Ribeiro Junior 提交于 2019-09-12 00:18 +08:00 . Github new repo.
TERM=vt100
export TERM
. /DSOP/DEXE/pusopo12 >/dev/null 2>&1
pela_cron=$1
loja=`hostname | cut -c6-8`
#
# executa conforme horario de BRASILIA
#
data=`date +%Y%m%d`
horas=`date +%H`
acertado=0
if [ -s /opt/SMA/conf/horario_verao ]
then
data_inicio_hr_verao=`tail -1 /opt/SMA/conf/horario_verao | grep -v "^#" | cut -d":" -f1`
data_fim_hr_verao=`tail -1 /opt/SMA/conf/horario_verao | grep -v "^#" | cut -d":" -f2`
[ `echo $data_inicio_hr_verao | wc -c` -ne 9 ] && data_inicio_hr_verao="88888888"
[ `echo $data_fim_hr_verao | wc -c` -ne 9 ] && data_fim_hr_verao="99999999"
if [ $data -ge $data_inicio_hr_verao -a $data -le $data_fim_hr_verao ]
then
if grep "^${LOJA}" /opt/SMA/conf/loja_sem_hora_verao >/dev/null 2>&1
then
TZ=GMT+1 export TZ
horas=`date +%H`
TZ=Brazil/East export TZ
if grep "^${LOJA}" /opt/SMA/conf/loja_fuso_menos_1 >/dev/null 2>&1
then
TZ=GMT+0 export TZ
horas=`date +%H`
TZ=Brazil/East export TZ
acertado=1
fi
else
if grep "^${LOJA}" /opt/SMA/conf/loja_fuso_menos_1 >/dev/null 2>&1
then
TZ=GMT+1 export TZ
horas=`date +%H`
TZ=Brazil/East export TZ
acertado=1
fi
fi
fi
fi
if [ $acertado -eq 0 ]
then
if grep "^${loja}" /opt/SMA/conf/loja_fuso_menos_1 >/dev/null 2>&1
then
TZ=GMT+2 export TZ
horas=`date +%H`
TZ=Brazil/East export TZ
fi
fi
if [ "$pela_cron" = "-n" ]
then
[ $horas -ne 2 ] && exit 0
fi
#
#cd $CONCENTRADOR/conector/log
#cp conector.err conector.err.`date +%Y%m%d%H%M%S`
#su wilbor -c "$CONCENTRADOR/conector/bin/fim"
echo "99999" >$LOG/qtde_erros_putefc04
ps -ef | grep conector | grep -vE "atualiza|grep" | \
while read linha
do
set $linha
kill -9 $2 >/dev/null 2>&1
done
sleep 5
tem_putef=`ps -ef | grep putefc01 | grep -v grep | wc -l`
tem_conector=`ps -ef | grep conector | grep -vE "atualiza|grep" | wc -l`
if [ $tem_putef -gt 0 -a $tem_conector -eq 0 ]
then
ps -ef | grep putefc01 | grep -v grep | \
while read linha
do
set $linha
kill -9 $2
done
fi
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/andrewgithub/ShellScripts.git
git@gitee.com:andrewgithub/ShellScripts.git
andrewgithub
ShellScripts
ShellScripts
master

搜索帮助