Commit 2741f5af authored by Natanael Copa's avatar Natanael Copa
Browse files

setup-webconf: create admin user by default

parent 7ba8c4c2
......@@ -7,17 +7,18 @@ PREFIX=
. $PREFIX/lib/
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;;
......@@ -28,6 +29,17 @@ while [ $# -gt 0 ]; do
if [ "$create_passwd" != "no" ]; then
askpassword "root ACF"
if [ -f /etc/acf/passwd ]; then
mv /etc/acf/passwd /etc/acf/passwd.backup
# 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
# install packages
apk_add mini_httpd $pkgs || exit 1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment