-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathelm.sh
40 lines (39 loc) · 1002 Bytes
/
elm.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# new Env('萝卜-饿了么');
# cron 0 9,18 * * * elm.sh
# 环境变量 elmck 值:SID=xxxx; cookie2=xxxx; (按格式来)
#pwd
_ftype=""
get_arch=`arch`
echo $get_arch
if [[ $get_arch =~ "x86_64" ]];then
_ftype="amd64"
elif [[ $get_arch =~ "x86" ]];then
_ftype="386"
elif [[ $get_arch =~ "i386" ]];then
_ftype="386"
elif [[ $get_arch =~ "aarch64" ]];then
_ftype="arm64"
elif [[ $get_arch =~ "arm" ]];then
_ftype="arm"
else
_ftype=""
fi
if [ $_ftype == "" ]; then
echo "不支持的架构$get_arch"
else
echo "执行$_ftype"
if [ -f "$PWD/ELM/elm-$_ftype" ]; then
echo "$PWD/ELM/elm-$_ftype"
eval "chmod +x ./ELM/elm-$_ftype"
eval "./ELM/elm-$_ftype -t elm"
else
if [ ! -f "$PWD/elm-$_ftype" ]; then
echo "在$PWD/ELM目录、$PWD目录下均未找到文件elm-$_ftype"
exit 1
fi
echo "$PWD/elm-$_ftype"
eval "chmod +x $PWD/elm-$_ftype"
eval "$PWD/elm-$_ftype -t elm"
fi
fi