Update 'kfg'
This commit is contained in:
22
kfg
22
kfg
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
NAME="kfg"
|
NAME="kfg"
|
||||||
VERSION="0.3"
|
VERSION="0.2"
|
||||||
|
|
||||||
HOME_PATH="$HOME"
|
HOME_PATH="$HOME"
|
||||||
TMP_PATH="$HOME_PATH/tmp/kamu_install"
|
TMP_PATH="$HOME_PATH/tmp/kamu_install"
|
||||||
@@ -41,13 +41,8 @@ function show_help_opt {
|
|||||||
echo -en "opt := {
|
echo -en "opt := {
|
||||||
${INFO}-h${ENDCOLOR} | ${INFO}--help${ENDCOLOR} \t\t Show this help,
|
${INFO}-h${ENDCOLOR} | ${INFO}--help${ENDCOLOR} \t\t Show this help,
|
||||||
${INFO}-y${ENDCOLOR} | ${INFO}--yes${ENDCOLOR} \t\t Skip confirmation questions,
|
${INFO}-y${ENDCOLOR} | ${INFO}--yes${ENDCOLOR} \t\t Skip confirmation questions,
|
||||||
${INFO}-m${ENDCOLOR} | ${INFO}--arch STRING${ENDCOLOR} \t Set the architecture string to be used when downloading files from repositories. Most common are "amd64", "arm64", "armhf", etc,
|
${INFO}-a${ENDCOLOR} | ${INFO}--arch STRING${ENDCOLOR} \t Set the architecture string to be used when downloading files from repositories. Most common are "amd64", "arm64", "armhf", etc,
|
||||||
${INFO}-d${ENDCOLOR} | ${INFO}--debug${ENDCOLOR}\t\t Print debug output,
|
${INFO}-d${ENDCOLOR} | ${INFO}--debug${ENDCOLOR}\t\t Print debug output,
|
||||||
${INFO}-c${ENDCOLOR} \t\t\t Install config files,
|
|
||||||
${INFO}-r${ENDCOLOR} \t\t\t Add configs into the RC file,
|
|
||||||
${INFO}-b${ENDCOLOR} \t\t\t Install binaries depending on the ARCH,
|
|
||||||
${INFO}-z${ENDCOLOR} \t\t\t Set shell to zsh,
|
|
||||||
${INFO}-a${ENDCOLOR} \t\t\t Just install everything
|
|
||||||
}\n"
|
}\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -432,6 +427,7 @@ function install {
|
|||||||
while :
|
while :
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
help) show_help_install; exit 0 ;;
|
||||||
"") break ;;
|
"") break ;;
|
||||||
all) p_all; shift ;;
|
all) p_all; shift ;;
|
||||||
zsh) p_zsh; shift ;;
|
zsh) p_zsh; shift ;;
|
||||||
@@ -455,7 +451,7 @@ if [ -z $1 ]; then
|
|||||||
show_help
|
show_help
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PARSED_ARGUMENTS=$(getopt -a -n install.sh -o hvyi:acrbm:p --long yes,help,debug,arch: -- "$@")
|
PARSED_ARGUMENTS=$(getopt -a -n install.sh -o hvdya: --long yes,help,debug,arch,verbose: -- "$@")
|
||||||
VALID_ARGUMENTS=$?
|
VALID_ARGUMENTS=$?
|
||||||
if [ "$VALID_ARGUMENTS" != "0" ]; then
|
if [ "$VALID_ARGUMENTS" != "0" ]; then
|
||||||
show_help
|
show_help
|
||||||
@@ -469,16 +465,10 @@ while :
|
|||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-h | --help) show_help ;;
|
-h | --help) show_help ;;
|
||||||
-v) P_Verbose=1 ; shift ;;
|
-v | --verbose) P_Verbose=1 ; shift ;;
|
||||||
-d | --debug) P_Debug=1 ; shift ;;
|
-d | --debug) P_Debug=1 ; shift ;;
|
||||||
-y | --yes) P_Yes=1 ; shift ;;
|
-y | --yes) P_Yes=1 ; shift ;;
|
||||||
-p) P_APT=1; P_DEB=1 ; shift ;;
|
-a | --arch) ARCH="$2" ; shift 2 ;;
|
||||||
-c) P_CONFIG=1 ; shift ;;
|
|
||||||
-r) P_RC=1 ; shift ;;
|
|
||||||
-b) P_BINARY=1 ; shift ;;
|
|
||||||
-m | --arch) ARCH="$2" ; shift 2 ;;
|
|
||||||
-z) P_ZSH=1 ; shift ;;
|
|
||||||
-a) P_APT=1; P_DEB=1; P_CONFIG=1; P_RC=1; P_BINARY=1; P_ZSH=1; shift ;;
|
|
||||||
# -- means the end of the arguments; drop this, and break out of the while loop
|
# -- means the end of the arguments; drop this, and break out of the while loop
|
||||||
--) shift; break ;;
|
--) shift; break ;;
|
||||||
# If invalid options were passed, then getopt should have reported an error,
|
# If invalid options were passed, then getopt should have reported an error,
|
||||||
|
|||||||
Reference in New Issue
Block a user