Minimal env : USER;PATH

This commit is contained in:
fred 2024-03-25 21:05:42 +01:00
parent d6d4e55689
commit e52490638f
2 changed files with 5 additions and 4 deletions

View File

@ -35,7 +35,7 @@ if [[ ! $crontest ]]; then
## HEADER
[[ $1 == "OFF" ]] && exit 0
[[ ! $(cat /tmp/mycron | grep -F 'SHELL') ]] && echo "SHELL=/bin/bash" > /tmp/newcron
[[ ! $(cat /tmp/mycron | grep -F 'PATH') ]] && echo "PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" >> /tmp/newcron
[[ ! $(cat /tmp/mycron | grep -F 'PATH') ]] && echo "USER=$USER;PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" >> /tmp/newcron
cat /tmp/mycron >> /tmp/newcron
# ADD 20h12.process.sh line
echo "12 20 * * * /bin/bash $MY_PATH/../20h12.process.sh > /tmp/20h12.log 2>&1" >> /tmp/newcron
@ -52,7 +52,7 @@ else
## HEADER
[[ $1 == "ON" ]] && exit 0
[[ ! $(cat /tmp/mycron | grep -F 'SHELL') ]] && echo "SHELL=/bin/bash" > /tmp/newcron
[[ ! $(cat /tmp/mycron | grep -F 'PATH') ]] && echo "PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" >> /tmp/newcron
[[ ! $(cat /tmp/mycron | grep -F 'PATH') ]] && echo "USER=$USER;PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" >> /tmp/newcron
## REMOVE 20h12.process.sh line
cat /tmp/mycron | grep -Ev '20h12.process.sh' >> /tmp/newcron
crontab /tmp/newcron
@ -64,7 +64,7 @@ else
echo "KEEPING 20H12 CRON ACTIVATED"
## LOW DISK RESSOURCES IPFS MODE
[[ ! $(cat /tmp/mycron | grep -F 'SHELL') ]] && echo "SHELL=/bin/bash" > /tmp/newcron
[[ ! $(cat /tmp/mycron | grep -F 'PATH') ]] && echo "PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" >> /tmp/newcron
[[ ! $(cat /tmp/mycron | grep -F 'PATH') ]] && echo "USER=$USER;PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" >> /tmp/newcron
cat /tmp/mycron >> /tmp/newcron
# ADD 20h12.process.sh line
[[ ! $(cat /tmp/mycron | grep '20h12.process.sh') ]] && echo "12 20 * * * /bin/bash $MY_PATH/../20h12.process.sh > /tmp/20h12.log 2>&1" >> /tmp/newcron

View File

@ -355,7 +355,8 @@ cp ~/Astroport/${PLAYER}/${TyPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json "$HOME/.
## TODO : Do we keep that ?
# echo "SEND TW LINK to GCHANGE MESSAGE"
[[ $3 ]] && ~/.zen/Astroport.ONE/tools/jaklis/jaklis.py -k ~/.zen/game/players/$PLAYER/secret.dunikey -n "$myDATA" send -d "$3" -t "${TITLE} ${MEDIAKEY}" -m "MEDIA : $myIPFSGW/ipfs/${IPFSREPFILEID}"
[[ $3 ]] \
&& ~/.zen/Astroport.ONE/tools/timeout.sh -t 12 ~/.zen/Astroport.ONE/tools/jaklis/jaklis.py -k ~/.zen/game/players/$PLAYER/secret.dunikey -n "$myDATA" send -d "$3" -t "${TITLE} ${MEDIAKEY}" -m "MEDIA : $myIPFSGW/ipfs/${IPFSREPFILEID}"
fi