diff --git a/add-crowdsec.sh b/add-crowdsec.sh index 09ed16f..f0dc2f8 100755 --- a/add-crowdsec.sh +++ b/add-crowdsec.sh @@ -47,11 +47,11 @@ usage(){ echo " -s skip setup"; } -NO_SETUP=false; +DO_SETUP=true; while getopts ":i" OPT; do case $OPT in s) - NO_SETUP=true; + DO_SETUP=false; ;; ?) echo "Invalid Option: -$OPTARG"; @@ -61,6 +61,6 @@ while getopts ":i" OPT; do done; main -if ! $NO_SETUP; then +if $DO_SETUP; then setup fi; \ No newline at end of file diff --git a/configure.sh b/configure.sh index 558d506..e424d0b 100755 --- a/configure.sh +++ b/configure.sh @@ -44,10 +44,29 @@ APT::Install-Suggests "0";" | tee /etc/apt/apt.conf.d/01norecommend >/dev/null if [ $DISTRO_PVE -eq 1 ]; then sed -i -E "s/.*zoxide.*//g" $HOME/.zshrc - else + elif $1; then $AWD/install-release.sh -r zsh-users/zsh-completions -k tarball -o completions.tar.gz -d "0 src" -p /usr/local/share/zsh/site-functions $AWD/install-release.sh -r ajeetdsouza/zoxide -m x86_64-unknown -p /usr/local/bin -n zoxide -f fi } -configure \ No newline at end of file +usage(){ + echo "Usage: $0 [OPTIONS]"; + echo "OPTIONS:"; + echo " -s skip install"; +} + +DO_INSTALL=true; +while getopts ":i" OPT; do + case $OPT in + s) + DO_INSTALL=false; + ;; + ?) + echo "Invalid Option: -$OPTARG"; + usage; + exit 1;; + esac; +done; + +configure $DO_INSTALL \ No newline at end of file diff --git a/init.sh b/init.sh index d483dea..e8180f0 100755 --- a/init.sh +++ b/init.sh @@ -107,7 +107,11 @@ Architectures: $OS_ARCH config(){ set_pkg_source - $AWD/configure.sh + if $1; then + $AWD/configure.sh + else + $AWD/configure.sh -s + fi } usage(){ @@ -124,7 +128,7 @@ usage(){ } PKG_BASE="$AWD/packages-base" -CONFIG_ONLY=false; +DO_INSTALL=true; MIRROR_SOURCE=1; while getopts ":f:ipm:" OPT; do case $OPT in @@ -132,7 +136,7 @@ while getopts ":f:ipm:" OPT; do PKG_BASE=$OPTARG; ;; c) - CONFIG_ONLY=true; + DO_INSTALL=false; ;; m) MIRROR_SOURCE=$OPTARG; @@ -144,7 +148,7 @@ while getopts ":f:ipm:" OPT; do esac; done; -config -if ! $CONFIG_ONLY; then +config $DO_INSTALL +if $DO_INSTALL; then $AWD/install.sh $PKG_BASE fi \ No newline at end of file