File: config

package info (click to toggle)
backuppc 4.4.0-11
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,752 kB
  • sloc: perl: 37,523; sh: 607; javascript: 176; makefile: 38; ansic: 6
file content (30 lines) | stat: -rw-r--r-- 664 bytes parent folder | download | duplicates (4)
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
#!/bin/sh

set -e

. /usr/share/debconf/confmodule

db_version 2.0

db_input high backuppc/reconfigure-webserver || true
db_input low backuppc/restart-webserver || true
db_go

if [ ! -f /etc/backuppc/htpasswd ]; then
    db_get "backuppc/tmppass"
    PASS=$RET
    if [ "$PASS" != "" ]; then
	# already set... do nothing
	echo
    else
	PASS=`perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..8)'`
	db_set "backuppc/tmppass" "$PASS"
    fi
    db_subst "backuppc/configuration-note" "site" `hostname -f`
    db_subst "backuppc/configuration-note" "pass" "$PASS"    
    db_input high "backuppc/configuration-note" || true
    db_go
fi

db_stop
exit 0