diff --git a/src/bin/init.sh b/src/bin/init.sh deleted file mode 100755 index 561de07..0000000 --- a/src/bin/init.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash - -source "${KIWI_ROOT}/inc/functions.sh" - -# read default baseconfig -conf_VERSION="${KIWI_VERSION}" -read_kiwi_config "${KIWI_ROOT}/etc/default.${KIWI_CONF_NAME}" - -# if pwd is a kiwi folder, read local baseconfig -if [ -f "./${KIWI_CONF_NAME}" ]; then - echo "[WARN] Overwriting existing '${KIWI_CONF_NAME}'" - read_kiwi_config "./${KIWI_CONF_NAME}" -fi - -function user_input() { - local prompt="${1}" - local varname="${2}" - - local input - read -p "${prompt} [Default '${!varname}']: " input - - eval "${varname}='${input:-${!varname}}'" -} - -declare -A config_explain -config_explain=( - [VERSION]="kiwi-config version" - [SUFFIX_PROJECT]="suffix for project directories" - [SUFFIX_DOWN]="suffix for disabled projects" -) - -for varname in "${!config_explain[@]}"; do - echo "${varname}" - user_input "Enter ${config_explain[${varname}]}" conf_${varname} -done - -exit 0 - -user_input "Choose kiwi-config version" conf_VERSION - -user_input "Enter suffix for project directories" conf_SUFFIX_PROJECT -user_input "Enter suffix for disabled projects" conf_SUFFIX_DOWN - -user_input "Enter suffix for disabled projects" conf_SUFFIX_DOWN -user_input "Enter suffix for disabled projects" conf_SUFFIX_DOWN - -user_input "Enter suffix for disabled projects" conf_SUFFIX_DOWN - -echo "conf_VERSION: ${conf_VERSION}" -echo "conf_SUFFIX_PROJECT: ${conf_SUFFIX_PROJECT}" - -exit 0 - -read -p "Choose kiwi-config version [Default '${conf_version}']: " kiwi_VERSION -conf_VERSION=${kiwi_VERSION:-${conf_VERSION}} - -read -p "suffix for kiwi-config version to use [Default '${conf_version}']: " kiwi_suffix_project - -echo "conf_VERSION: ${conf_VERSION}" \ No newline at end of file diff --git a/src/bin/main.sh b/src/bin/main.sh deleted file mode 100755 index 5a442fa..0000000 --- a/src/bin/main.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -command="${1}" -shift 1 - -case "${command}" in - "init") - exec "${KIWI_ROOT}/bin/${command}.sh" "${@}" - ;; - *) - echo "Unknown kiwi command '${command}'." - exit 1 - ;; -esac \ No newline at end of file diff --git a/src/etc/default.kiwi.conf b/src/etc/default.kiwi.conf deleted file mode 100644 index 4e9712d..0000000 --- a/src/etc/default.kiwi.conf +++ /dev/null @@ -1,7 +0,0 @@ -SUFFIX_PROJECT=.project -SUFFIX_DOWN=.down - -DOCKERNET=kiwinet -DOCKERCIDR=10.22.46.0/24 - -TARGETROOT=/var/kiwi diff --git a/src/inc/functions.sh b/src/inc/functions.sh deleted file mode 100644 index 6f88a53..0000000 --- a/src/inc/functions.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -function read_kiwi_config() { - local conf_file="${1}" - local conf_prefix="${2:-conf_}" - - local conf_file_content=$(sed -r 's/^\s*(\S+)/'${conf_prefix}'\1/g' "${conf_file}") - eval "${conf_file_content}" -} - -function write_kiwi_config() { - local conf_prefix="${2:-conf_}" - - -} \ No newline at end of file