Replace bin only on successful connection

This commit is contained in:
Christer Warén
2025-09-27 00:02:35 +03:00
parent bce9c3c4d6
commit 592cd95f42
2 changed files with 10 additions and 4 deletions

View File

@@ -14,8 +14,11 @@ wx-install(){
fi
mkdir $HOME/bin &> /dev/null
if [[ $(curl -s -o /dev/null -w "%{http_code}" https://git.waren.io/warengroup/wx/raw/branch/master/wx) -eq 200 ]]
then
curl https://git.waren.io/warengroup/wx/raw/branch/master/wx -o $HOME/bin/wx &> /dev/null
chmod +x $HOME/bin/wx &> /dev/null
fi
CRONJOB_NAME="#Warén CLI: Auto"
CRONJOB_TASK="*/5 * * * * $HOME/bin/wx auto"

3
wx
View File

@@ -425,8 +425,11 @@ wx-install(){
fi
mkdir $HOME/bin &> /dev/null
if [[ $(curl -s -o /dev/null -w "%{http_code}" https://git.waren.io/warengroup/wx/raw/branch/master/wx) -eq 200 ]]
then
curl https://git.waren.io/warengroup/wx/raw/branch/master/wx -o $HOME/bin/wx &> /dev/null
chmod +x $HOME/bin/wx &> /dev/null
fi
CRONJOB_NAME="#Warén CLI: Auto"
CRONJOB_TASK="*/5 * * * * $HOME/bin/wx auto"