forked from SynoCommunity/spksrc
/
install_uifile.sh
executable file
·48 lines (43 loc) · 1.23 KB
/
install_uifile.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
41
42
43
44
45
46
47
48
#!/bin/sh
set +x
GetShares()
{
for share in `sudo /usr/syno/sbin/synoshare --enum ALL|tail -n +3`; do
path=$(sudo /usr/syno/sbin/synoshare --get "${share}"|sed -n 's/.*Path.*\[\(.*\)\]/\1/p')
echo "[\"$path\", \"$share (${path})\"]"
done | tr -s '\n' ',' | sed -e 's/,$//'
}
FIRST=`/bin/cat<<EOF
{
"step_title": "Data location",
"items": [{
"desc": "The installer will download and build the latest versions of hass.io and homeassistant. <br/>Please fill the desired storage location for the data directory below (create a new <b>Shared Folder</b> if none of the ones below suits storage of hass.io data)."
},{
"type": "combobox",
"subitems": [{
"key": "wizard_share_path",
"desc": "Shared Folder to store hass.io data in",
"editable": false,
"mode": "local",
"value": "",
"valueField": "path",
"displayField": "display_name",
"store": {
"xtype": "arraystore",
"fields": ["path", "display_name"],
"data": [$(GetShares)]
}
}]
}, {
"type": "textfield",
"subitems": [{
"key": "wizard_folder_name",
"desc": "Data folder name",
"value": "hass.io",
"disabled": false
}]
}]
}
EOF`
echo "[$FIRST]" > $SYNOPKG_TEMP_LOGFILE
exit 0