68 |
exit 1 |
exit 1 |
69 |
fi |
fi |
70 |
|
|
|
# exclude the desktop session, which is always the first |
|
|
declare -i counter=0 |
|
71 |
while read line |
while read line |
72 |
do |
do |
73 |
if [[ ${counter} -gt 0 ]] |
session=$(echo ${line} | cut -d"'" -f 2) |
74 |
then |
description=$(echo ${line} | cut -d"'" -f 4) |
75 |
session=$(echo ${line} | cut -d"'" -f 2) |
decho "Session: '${session}' -> Description '${description}'" |
|
description=$(echo ${line} | cut -d"'" -f 4) |
|
|
decho "Session: '${session}' -> Description '${description}'" |
|
|
|
|
|
# import or update db entry |
|
|
id=$(mysqldo "select id from values_storefront_session where session='${session}';") |
|
|
if [[ -z ${id} ]] |
|
|
then |
|
|
mysqldo "insert into values_storefront_session (session,description,store,enabled) values('${session}','${description}','${STOREFRONT_STORE}','1');" |
|
|
else |
|
|
mysqldo "update values_storefront_session set session='${session}',description='${description}',store='${STOREFRONT_STORE}',enabled='1' where id='${id}';" |
|
|
fi |
|
76 |
|
|
77 |
# get and save id |
# import or update db entry |
78 |
id=$(mysqldo "select id from values_storefront_session where session='${session}';") |
id=$(mysqldo "select id from values_storefront_session where session='${session}';") |
79 |
export IMPORTED_IDS+=" ${id}" |
if [[ -z ${id} ]] |
80 |
|
then |
81 |
|
mysqldo "insert into values_storefront_session (session,description,store,enabled) values('${session}','${description}','${STOREFRONT_STORE}','1');" |
82 |
|
else |
83 |
|
mysqldo "update values_storefront_session set session='${session}',description='${description}',store='${STOREFRONT_STORE}',enabled='1' where id='${id}';" |
84 |
fi |
fi |
85 |
(( counter++ )) |
|
86 |
|
# get and save id |
87 |
|
id=$(mysqldo "select id from values_storefront_session where session='${session}';") |
88 |
|
export IMPORTED_IDS+=" ${id}" |
89 |
done << EOF |
done << EOF |
90 |
$(echo "${SESSION_LIST}") |
$(echo "${SESSION_LIST}") |
91 |
EOF |
EOF |