File: mini-httpd.postinst

package info (click to toggle)
mini-httpd 1.30-15
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,568 kB
  • sloc: ansic: 3,634; sh: 156; makefile: 109
file content (32 lines) | stat: -rw-r--r-- 665 bytes parent folder | download | duplicates (2)
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
#!/bin/sh
set -e

# From apache2:
# check if we're installing or updating to
# prevent recopying default index.html on update.

is_fresh_install()
{
	if [ -z "$2" ] ; then
		return 0
	fi
	return 1
}
if is_fresh_install $@ ; then
	mkdir -p /var/www/html
	do_copy="true"
	for file in index.html index.htm index.xhtml index.xht Default.htm index.cgi index.php index.mini-httpd.html ; do
		if [ -e "/var/www/html/$file" ] ; then
			do_copy="false"
			break
		fi
	done
	if [ "$do_copy" = "true" ]; then
		if [ -r /usr/share/doc/mini-httpd/examples/index.html ]; then
			cp /usr/share/doc/mini-httpd/examples/index.html /var/www/html/index.html
		fi
	fi
fi


#DEBHELPER#