reload_flag=""
if [[ -n "${DEBUG}" ]]; then
reload_flag="--reload"
fi
if [[ -n "${WORKER_COUNT}" ]]; then
workers=${WORKER_COUNT}
else
workers=2
fi
gunicorn --workers ${workers} \
--bind 0.0.0.0:8000 \
${reload_flag} main.wsgi
Писали такие конструкции чтобы проверить наличие флага и сформировать команду правильно?
На самом деле можно сделать тоже самое проще. Для этого используются операторы условной подстановки, доступные в оболочках семейства POSIX.
:- для установки значений по умолчанию
${WORKER_COUNT:-2}
Если переменная не объявлена, то будет дефолтное значение 2.
:+ подставляет указанный текст, если переменная не пуста
${DEBUG:+--reload}
Если что-то есть в переменной то распечатается текст после символа +, в противном случае - ничего. Удобно для опциональных флагов, как в нашем примере.
Итого наш скрипт может выглядеть так:
gunicorn --workers ${WORKER_COUNT:-2} \
--bind 0.0.0.0:8000 \
${DEBUG:+--reload} main.wsgi
Есть еще два оператора.
:= не только подставить дефолтное значение, но и присвоить его переменной, если она пуста
# никаких переменных еще нет
VAL1=${VAL2:=hello}
# теперь доступны обе
echo $VAL1 $VAL2
# hello hello
:? остановить выполнение с ошибкой, если переменной нет.
echo ${MISS:?is required}
bash: MISS: is required
Код выхода будет 1.
#tricks#linux
15 hours ago, Antalpha (@AntalphaGlobal) sent 1,000 $XAUT (~$5.16M) into #Bybit, likely to sell.
https://intel.arkm.com/explorer/entity/antalpha
https://x.com/OnchainLens/status/2026838079651328216
Follow @onchainlens for more onchain updates
A newly created wallet withdrew 500 $XAUT worth $2.57M from #Bybit.
Address: 0xbe9De876a5Cf802F574899A2763aE6a5D5D93CBa
https://x.com/OnchainLens/status/2029186288763715651
Follow @onchainlens for more onchain updates
15 hours ago, Antalpha (@AntalphaGlobal) sent 1,000 $XAUT (~$5.16M) into #Bybit, likely to sell.
https://intel.arkm.com/explorer/entity/antalpha
https://x.com/OnchainLens/status/2026838079651328216
Follow @onchainlens for more onchain updates
13 hours ago, Antalpha (@AntalphaGlobal) sent 1,000 $XAUT (~$5M) into #Bybit, likely to sell.
They still hold 59,033 $XAUT (~$300.69M).
https://intel.arkm.com/explorer/entity/antalpha
https://x.com/OnchainLens/status/2025020760608440597
Follow @onchainlens for more onchain updates
A whale withdrew 593.98 $XAUT worth ($2.78M) from #Bybit in the past 3 days after being dormant for 8 months.
Address - 0x57655B342B7bf1a1134B572e43eB62BBE56BF7CF
Data - @nansen_ai
https://x.com/OnchainLens/status/2018184847295218173
Follow @onchainlens for more onchain updates
The newly created wallet "0x0E4" further withdrew 450 $XAUT worth ($2.51M)from #Bybit.
Now the whale holds 1.25K $XAUT worth $6.98M
Address - 0x0E4F3ed5B2A3dB2A2940c638418530e9f5c4927E
Data - @nansen_ai
https://x.com/OnchainLens/status/2016757455565574543
Follow @onchainlens for more onchain updates
The whale "0x0a5" bought 602.49 $XAUT, worth $3.05M, from #Bybit.
Over the past 4 days, the whale has bought 1,469.29 $XAUT, worth $7.33M, from #Bybit.
https://intel.arkm.com/explorer/address/0x0a5e3968f95d5aD4Fac72E1420A2BFFeedb7cbEB
https://x.com/OnchainLens/status/2015679418803552716
Follow @onchainlens for more onchain updates
A wallet linked to the Pendle Team (@pendle_fi) deposited 1.8M $PENDLE, worth $3.61M, into #Bybit after holding it for 3-4 years.
The wallet received these $PENDLE for $266K from the Pendle Vesting Wallet.
Address: 0xf82e1E9381A1d92B5897eBe2F9B61160222f1aeb
https://x.com/OnchainLens/status/2015378723818942854
Follow @onchainlens for more onchain updates
A whale bought 566.80 $XAUT worth ($2.79M) from #Bybit in the past 2 days.
The whale still hold $11.36M $USDT and likely to buy more.
Address - 0x0a5e3968f95d5aD4Fac72E1420A2BFFeedb7cbEB
Data - @nansen_ai
https://x.com/OnchainLens/status/2014673139159240920
Follow @onchainlens for more onchain updates
A whale deposited 665,035 $HYPE, worth $14.54M into #Bybit, making a profit of $7.04M.
The whale initially bought 651,895 $HYPE for $7.5M at a price of $11.5, between Dec 3, 2024, and Dec 8, 2024, and sent it for staking.
https://hyperbot.network/trader/0xffe664491482ae9db6ba9e55c2ed1ea55c700a52
https://hyperevmscan.io/address/0xffe664491482ae9db6ba9e55c2ed1ea55c700a52
https://x.com/OnchainLens/status/2014571958009250155
Follow @onchainlens for more onchain updates
A wallet linked to the Pendle Team (@pendle_fi) deposited 1.8M $PENDLE, worth $3.84M, into #Bybit after holding it for 3 years.
The wallet received these $PENDLE for $266K from the Pendle Vesting Wallet.
Address: 0x6b4166974fcf730d7933656d26d52922ee285cf0
https://x.com/OnchainLens/status/2014514593566248989
Follow @onchainlens for more onchain updates