equal
deleted
inserted
replaced
23 declare(ticks=1); |
23 declare(ticks=1); |
24 |
24 |
25 // trap SIGTERM |
25 // trap SIGTERM |
26 pcntl_signal(SIGTERM, 'sigterm'); |
26 pcntl_signal(SIGTERM, 'sigterm'); |
27 pcntl_signal(SIGINT, 'sigterm'); |
27 pcntl_signal(SIGINT, 'sigterm'); |
28 pcntl_signal(SIGUSR1, 'handle_refresh_signal'); |
28 pcntl_signal(SIGHUP, 'handle_refresh_signal'); |
29 } |
29 } |
30 |
30 |
31 @ini_set('display_errors', 'on'); |
31 @ini_set('display_errors', 'on'); |
32 |
32 |
33 // get the root |
33 // get the root |
110 $playlist = array(); |
110 $playlist = array(); |
111 $amarok_home = false; |
111 $amarok_home = false; |
112 rebuild_playlist(); |
112 rebuild_playlist(); |
113 |
113 |
114 // startup webserver |
114 // startup webserver |
115 $ip = array(); |
|
116 if ( !$enable_ipv4 && !$enable_ipv6 ) |
|
117 { |
|
118 warning('Both IPv4 and IPv6 are disabled, enabling IPv4 access'); |
|
119 $enable_ipv4 = true; |
|
120 } |
|
121 if ( $public ) |
115 if ( $public ) |
122 { |
116 { |
123 if ( $enable_ipv6 ) |
117 if ( $enable_ipv6 ) |
124 $ip[] = '::'; |
118 $ip = '::'; |
125 if ( $enable_ipv4 ) |
119 else |
126 $ip[] = '0.0.0.0'; |
120 $ip = '0.0.0.0'; |
127 } |
121 } |
128 else |
122 else |
129 { |
123 { |
130 if ( $enable_ipv6 ) |
124 if ( $enable_ipv6 ) |
131 $ip[] = '::1'; |
125 $ip = '::1'; |
132 if ( $enable_ipv4 ) |
126 else |
133 $ip[] = '127.0.0.1'; |
127 $ip = '127.0.0.1'; |
134 } |
128 } |
135 |
129 |
136 $port = 7447; |
130 $port = 7447; |
137 |
131 |
138 try |
132 try |