Ai
1 Star 0 Fork 0

子安/ShellScripts

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
putefc02.954 1.94 KB
Copy Edit Raw Blame History
Agapito Rojas Ribeiro Junior authored 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 -v 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 -v 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

Search