summaryrefslogtreecommitdiffstats
path: root/setup-webconf.in
diff options
context:
space:
mode:
Diffstat (limited to 'setup-webconf.in')
-rw-r--r--setup-webconf.in16
1 files changed, 14 insertions, 2 deletions
diff --git a/setup-webconf.in b/setup-webconf.in
index f950db1..3769a12 100644
--- a/setup-webconf.in
+++ b/setup-webconf.in
@@ -7,17 +7,18 @@ PREFIX=
. $PREFIX/lib/libalpine.sh
usage() {
- echo "$PROGRAM [-ah] [-l address] [PACKAGE...]"
+ echo "$PROGRAM [-ahn] [-l address] [PACKAGE...]"
exit 0;
}
pkgs="acf-core acf-alpine-baselayout acf-apk-tools"
-while getopts "ahl:" opt ; do
+while getopts "ahl:n" opt ; do
case $opt in
a) pkgs=`apk_fetch -l | grep ^acf-`;;
h) usage;;
l) address="$OPTARG";;
+ n) create_passwd=no;;
*) usage;;
esac
done
@@ -28,6 +29,17 @@ while [ $# -gt 0 ]; do
shift
done
+if [ "$create_passwd" != "no" ]; then
+ askpassword "root ACF"
+ if [ -f /etc/acf/passwd ]; then
+ mv /etc/acf/passwd /etc/acf/passwd.backup
+ fi
+ # this will show password on process list but we assume user is alone
+ # on the box at this stage
+ _md5passwd=$(echo -n "$_password" | md5sum)
+ echo "root:$_md5passwd:Admin account:ADMIN" >/etc/acf/passwd
+fi
+
# install packages
apk_add mini_httpd $pkgs || exit 1