|
| 1 | +#!/bin/bash |
| 2 | +# lib/alpine/config.sh |
| 3 | +# |
| 4 | +# This program is free software: you can redistribute it and/or modify |
| 5 | +# it under the terms of the GNU General Public License as published by |
| 6 | +# the Free Software Foundation, either version 3 of the License, or |
| 7 | +# any later version. |
| 8 | +# |
| 9 | +# This program is distributed in the hope that it will be useful, |
| 10 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | +# GNU General Public License for more details. |
| 13 | +# |
| 14 | +# You should have received a copy of the GNU General Public License |
| 15 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | +# |
| 17 | +[[ -z $packages ]] && packages="openrc bc cdrkit curl gcc g++ git gzip lftp m4 make mariadb mariadb-client net-tools nfs-utils openssh openssl perl perl-crypt-passwdmd5 php7 php7-session php7-fpm php7-mbstring php7-mcrypt php7-soap php7-openssl php7-gmp php7-pdo_odbc php7-json php7-dom php7-pdo php7-zip php7-mysqli php7-sqlite3 php7-apcu php7-pdo_pgsql php7-bcmath php7-gd php7-odbc php7-pdo_mysql php7-pdo_sqlite php7-gettext php7-xmlreader php7-xmlrpc php7-bz2 php7-iconv php7-pdo_dblib php7-curl php7-sockets php7-mysqli php7-ctype syslinux tar tftp-hpa vsftpd wget xz" |
| 18 | +[[ -z $packageinstaller ]] && packageinstaller="apk add" |
| 19 | +[[ -z $packagelist ]] && packagelist="apk info" |
| 20 | +[[ -z $packageupdater ]] && packageupdater="apk update && apk upgrade" |
| 21 | +[[ -z $packmanUpdate ]] && packmanUpdate="$packageinstaller" |
| 22 | +[[ -z $packageQuery ]] && packageQuery="apk info -e \$x " |
| 23 | +[[ -z $langPackages ]] && langPackages="iso-codes" |
| 24 | +[[ -z $dhcpname ]] && dhcpname="" |
| 25 | +if [[ -z $webdirdest ]]; then |
| 26 | + if [[ -z $docroot ]]; then |
| 27 | + docroot="/var/www/" |
| 28 | + webdirdest="${docroot}fog/" |
| 29 | + elif [[ "$docroot" != *'fog'* ]]; then |
| 30 | + webdirdest="${docroot}fog/" |
| 31 | + else |
| 32 | + webdirdest="${docroot}/" |
| 33 | + fi |
| 34 | +fi |
| 35 | +[[ -z $webredirect ]] && webredirect="${webdirdest}/index.php" |
| 36 | +[[ -z $apacheuser ]] && apacheuser="nginx" |
| 37 | +[[ -z $apachelogdir ]] && apachelogdir="/var/log/nginx" |
| 38 | +[[ -z $apacheerrlog ]] && apacheerrlog="$apachelogdir/error.log" |
| 39 | +[[ -z $apacheacclog ]] && apacheacclog="$apachelogdir/access.log" |
| 40 | +[[ -z $httpdconf ]] && httpdconf="/etc/nginx/nginx.conf" |
| 41 | +[[ -z $etcconf ]] && etcconf="/etc/nginx/http.d/default.conf" |
| 42 | +[[ -z $phpini ]] && phpini="/etc/php7/php.ini" |
| 43 | +[[ -z $storageLocation ]] && storageLocation="/images" |
| 44 | +[[ -z $storageLocationCapture ]] && storageLocationCapture="${storageLocation}/dev" |
| 45 | +[[ -z $dhcpconfig ]] && dhcpconfig="/etc/dhcpd.conf" |
| 46 | +[[ -z $dhcpconfigother ]] && dhcpconfigother="/etc/dhcp/dhcpd.conf" |
| 47 | +[[ -z $tftpdirdst ]] && tftpdirdst="/var/tftpboot" |
| 48 | +[[ -z $tftpconfig ]] && tftpconfig="/etc/xinetd.d/tftpd" |
| 49 | +[[ -z $ftpxinetd ]] && ftpxinetd="/etc/xinetd.d/vsftpd" |
| 50 | +[[ -z $ftpconfig ]] && ftpconfig="/etc/vsftpd.conf" |
| 51 | +[[ -z $dhcpd ]] && dhcpd="dhcpd4" |
| 52 | +[[ -z $snapindir ]] && snapindir="/opt/fog/snapins" |
| 53 | +[[ -z $php_ver ]] && php_ver="7" |
| 54 | +[[ -z $phpfpm ]] && phpfpm="php-fpm${php_ver}" |
| 55 | +[[ -z $webserver ]] && webserver="nginx" |
| 56 | +packages="${packages} ${webserver}" |
0 commit comments