pwrtray: Compilefix on avr32
[openwrt/svn-archive/archive.git] / multimedia / kissdx / files / kissdx.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2008 OpenWrt.org
3
4 START=65
5 CFGFILE=/tmp/kissdx.conf
6
7 create_configfile() {
8 local signature pidfile characterset \
9 picturetargetwidth picturetargetheight picturemaxzoompercent \
10 enablehiddenfilestext enablehiddenfilesminutes \
11 listhiddenentries displaysequencenumbers
12 local path_audio path_video path_picture
13 local files_audio files_video files_picture files_iso
14 local subtitles_filemapping
15 local recentfiles_foldername recentfiles_max
16 local kml_forwardurl
17
18 echo '### AUTOGENERATED CONFIGURATION FILE - DO NOT EDIT ###' > $CFGFILE
19 echo '### Edit /etc/config/kissdx to make changes to setup ###' >> $CFGFILE
20 echo '' >> $CFGFILE
21
22 config_get signature server signature
23 config_get pidfile server pidfile
24 config_get characterset server characterset
25 config_get picturetargetwidth server picturetargetwidth
26 config_get picturetargetheight server picturetargetheight
27 config_get picturemaxzoompercent server picturemaxzoompercent
28 config_get enablehiddenfilestext server enablehiddenfilestext
29 config_get enablehiddenfilesminutes server enablehiddenfilesminutes
30 config_get listhiddenentries server listhiddenentries
31 config_get displaysequencenumbers server displaysequencenumbers
32
33 config_get path_audio paths audio
34 config_get path_video paths video
35 config_get path_picture paths picture
36
37 config_get files_audio files audio
38 config_get files_video files video
39 config_get files_picture files picture
40 config_get files_iso files iso
41
42 config_get subtitles_filemapping subtitles filemapping
43
44 config_get recentfiles_foldername recentfiles foldername
45 config_get recentfiles_max recentfiles max
46
47 config_get kml_forwardurl kml forwardurl
48
49 echo 'serversignature = ' $signature >> $CFGFILE
50 echo '#listenaddress = 192.168.1.2' >> $CFGFILE
51 echo '#networktimeoutinterval = 3600' >> $CFGFILE
52 echo '#adminserver_port = 8003' >> $CFGFILE
53 echo 'configautoload = no' >> $CFGFILE
54 echo '#dvdaccessmethod = libdvdnav' >> $CFGFILE
55 echo '#renamefiletypes = ts:mpg,wav:mp3' >> $CFGFILE
56 echo 'pidfilepath = ' $pidfile >> $CFGFILE
57 echo '#persistentstoragepath = /tmp/kissdx' >> $CFGFILE
58 echo '#server_character_set = CP850' >> $CFGFILE
59 echo '#client_character_set = ISO-8859-1' >> $CFGFILE
60 echo 'config_character_set = ' $characterset >> $CFGFILE
61 echo 'playlist_character_set = ' $characterset >> $CFGFILE
62 echo 'displaysequencenumbers = ' $displaysequencenumbers >> $CFGFILE
63 echo '' >> $CFGFILE
64 echo '# 0 = caching disabled, -1 = no limit or amount of pictures in cache' >> $CFGFILE
65 echo 'picturecachesize = 0' >> $CFGFILE
66 echo '#picturecachetrimminginterval = 10' >> $CFGFILE
67 echo '' >> $CFGFILE
68 echo 'audiopath = ' $path_audio >> $CFGFILE
69 echo 'videopath = ' $path_video >> $CFGFILE
70 echo 'picturepath = ' $path_picture >> $CFGFILE
71 echo '' >> $CFGFILE
72 echo 'audiofileextensions = ' $files_audio >> $CFGFILE
73 echo 'videofileextensions = ' $files_video >> $CFGFILE
74 echo 'picturefileextensions = ' $files_picture >> $CFGFILE
75 echo 'isofileextensions = ' $files_iso >> $CFGFILE
76 echo '' >> $CFGFILE
77 echo 'listhiddenentries = ' $listhiddenentries >> $CFGFILE
78 echo 'enablehiddenfilestext = ' $enablehiddenfilestext >> $CFGFILE
79 echo 'enablehiddenfilesminutes = ' $enablehiddenfilesminutes >> $CFGFILE
80 echo '' >> $CFGFILE
81 echo 'picturetargetwidth = ' $picturetargetwidth >> $CFGFILE
82 echo 'picturetargetheight = ' $picturetargetheight >> $CFGFILE
83 echo 'picturemaxzoompercent = ' $picturemaxzoompercent >> $CFGFILE
84 echo '' >> $CFGFILE
85 echo 'subtitlefilemapping = ' $subtitles_filemapping >> $CFGFILE
86 echo '' >> $CFGFILE
87 echo 'recentlyusedfoldername = ' $recentfiles_foldername >> $CFGFILE
88 echo 'max_recent_files = ' $recentfiles_max >> $CFGFILE
89 echo '' >> $CFGFILE
90 echo 'kmlforwardurl = ' $kml_forwardurl >> $CFGFILE
91 echo '' >> $CFGFILE
92 echo '#pretrigger = /usr/bin/kissd-pretrigger' >> $CFGFILE
93 echo '#posttrigger = /usr/bin/kissd-posttrigger' >> $CFGFILE
94 echo '#directorypretrigger = /usr/bin/kissddirpretrigger' >> $CFGFILE
95 echo '#directoryposttrigger = /usr/bin/kisdddirposttrigger' >> $CFGFILE
96 }
97
98 start () {
99 config_load kissdx
100 create_configfile
101 /usr/bin/kissdx -c $CFGFILE -d
102 }
103
104 stop() {
105 killall -9 kissdx
106 }