96 |
local serial="${CLASS_ARGV[0]}" |
local serial="${CLASS_ARGV[0]}" |
97 |
local values |
local values |
98 |
local id |
local id |
99 |
|
local xypos |
100 |
|
local widthheight |
101 |
|
|
102 |
values=$(mysqldo "select id from cfg_idesk_icon where serial='${serial}';") |
values=$(mysqldo "select id from cfg_idesk_icon where serial='${serial}';") |
103 |
for id in ${values} |
for id in ${values} |
108 |
eecho "Name must not be empty id->'${id}'" |
eecho "Name must not be empty id->'${id}'" |
109 |
continue |
continue |
110 |
fi |
fi |
|
if [[ -z ${cfg_idesk_icon_command} ]] |
|
|
then |
|
|
eecho "Command must not be empty id->'${id}'" |
|
|
continue |
|
|
fi |
|
111 |
if [[ -z ${cfg_idesk_icon_enabled} ]] |
if [[ -z ${cfg_idesk_icon_enabled} ]] |
112 |
then |
then |
113 |
eecho "Enabled must not be empty id->'${id}'" |
eecho "Enabled must not be empty id->'${id}'" |
115 |
fi |
fi |
116 |
if [[ ${cfg_idesk_icon_enabled} = 1 ]] |
if [[ ${cfg_idesk_icon_enabled} = 1 ]] |
117 |
then |
then |
118 |
control_client "${serial}" set idesk.icon add "${cfg_idesk_icon_name}" "${cfg_idesk_icon_command}" "${cfg_idesk_icon_icon}" "${cfg_idesk_icon_filename}" "${cfg_idesk_icon_xpos},${cfg_idesk_icon_ypos}" "${cfg_idesk_icon_width},${cfg_idesk_icon_height}" "${cfg_idesk_icon_default_icon}" |
if [[ -n ${cfg_idesk_icon_xpos} ]] && [[ -n ${cfg_idesk_icon_ypos} ]] |
119 |
|
then |
120 |
|
xypos="${cfg_idesk_icon_xpos},${cfg_idesk_icon_ypos}" |
121 |
|
fi |
122 |
|
if [[ -n ${width} ]] && [[ -n ${height} ]] |
123 |
|
then |
124 |
|
widthheight="${cfg_idesk_icon_width},${cfg_idesk_icon_height}" |
125 |
|
fi |
126 |
|
control_client "${serial}" set idesk.icon add "${cfg_idesk_icon_name}" "${cfg_idesk_icon_command}" "${cfg_idesk_icon_icon}" "${cfg_idesk_icon_filename}" "${xypos}" "${widthheight}" "${cfg_idesk_icon_default_icon}" |
127 |
elif [[ ${cfg_idesk_icon_enabled} = 0 ]] |
elif [[ ${cfg_idesk_icon_enabled} = 0 ]] |
128 |
|
then |
129 |
control_client "${serial}" set idesk.icon del "${cfg_idesk_icon_name}" |
control_client "${serial}" set idesk.icon del "${cfg_idesk_icon_name}" |
130 |
# remove from database too |
# remove from database too |
131 |
mysqldo "delete from cfg_idesk_icon where id='${id}';" |
mysqldo "delete from cfg_idesk_icon where id='${id}';" |