Skip to content

Commit

Permalink
fix: dgiot_install.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
AvantLiu committed Sep 24, 2021
1 parent 6100f50 commit 84564e8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
1 change: 1 addition & 0 deletions apps/dgiot_bridge/include/dgiot_bridge.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@
-define(BACKEND_CHL, 3).
-define(FEATURE_CHL, 4).
-define(AUTH_CHL, 5).
-define(defult_CHL, 5).

19 changes: 19 additions & 0 deletions apps/dgiot_parse/src/dgiot_parse.erl
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,25 @@ get_objectid(Class, Map) ->
Map#{
<<"objectId">> => Pid
};
<<"post_classes_producttemplet">> ->
get_objectid(<<"ProductTemplet">>, Map);
<<"ProductTemplet">> ->
NetType = maps:get(<<"netType">>, Map, <<"">>),
Category = maps:get(<<"category">>, Map, <<"">>),
Name = maps:get(<<"name">>, Map, <<"">>),
<<Pid:10/binary, _/binary>> = dgiot_utils:to_md5(<<"ProductTemplet", Category/binary, NetType/binary, Name/binary>>),
Map#{
<<"objectId">> => Pid
};
<<"post_classes_category">> ->
get_objectid(<<"Category">>, Map);
<<"Category">> ->
Type = maps:get(<<"type">>, Map, <<"">>),
Name = maps:get(<<"name">>, Map, <<"">>),
<<Pid:10/binary, _/binary>> = dgiot_utils:to_md5(<<"Category", Type/binary, Name/binary>>),
Map#{
<<"objectId">> => Pid
};
<<"post_classes_device">> ->
get_objectid(<<"Device">>, Map);
<<"Device">> ->
Expand Down
7 changes: 4 additions & 3 deletions dgiot_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ function install_postgres() {

### 创建目录和用户,以及配置环境变化
echo -e "${GREEN}create postgres user and group ${NC}"
set +uxe
egrep "^postgres" /etc/passwd >/dev/null
if [ $? -eq 0 ]; then
echo -e "${GREEN} postgres user and group exist ${NC}"
Expand All @@ -354,7 +355,7 @@ function install_postgres() {

tar xvf postgresql-12.0.tar.gz &> /dev/null
cd postgresql-12.0

set -ue
yum_install_postgres
echo -e "`date +%F_%T`: ${GREEN} configure postgres${NC}"
./configure --prefix=/usr/local/pgsql/12 --with-pgport=7432 --enable-nls --with-python --with-tcl --with-gssapi --with-icu --with-openssl --with-pam --with-ldap --with-systemd --with-libxml --with-libxslt &> /dev/null
Expand Down Expand Up @@ -874,8 +875,8 @@ function install_nginx() {
if [ ! -f ${script_dir}/nginx.conf ]; then
wget $fileserver/nginx.conf -O ${script_dir}/nginx.conf &> /dev/null
fi
if [ -f ${script_dir}/prod.iotn2n.com.zip ]; then
wget $fileserver/prod.iotn2n.com.zip -O ${script_dir}/prod.iotn2n.com.zip &> /dev/null
if [ -f ${script_dir}/${domain_name}.zip ]; then
wget $fileserver/${domain_name}.zip -O ${script_dir}/${domain_name}.zip &> /dev/null
fi

rm /etc/nginx/nginx.conf -rf
Expand Down

0 comments on commit 84564e8

Please sign in to comment.