mirror of
https://github.com/aljazceru/cyphernode.git
synced 2025-12-25 16:44:49 +01:00
added recreate feature to skip all prompts and recreate installation configuration based on previsous selection in props.json
This commit is contained in:
@@ -2,12 +2,16 @@
|
||||
configure() {
|
||||
local current_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
||||
## build setup docker image
|
||||
local recreate=""
|
||||
|
||||
if [[ $1 == 1 ]]; then
|
||||
recreate="recreate"
|
||||
fi
|
||||
|
||||
build_docker_image ../ cyphernodeconf && clear && echo "Thinking..."
|
||||
|
||||
# configure features of cyphernode
|
||||
docker run -v $current_path/../data:/data \
|
||||
--log-driver=none\
|
||||
--rm -it cyphernodeconf:latest
|
||||
|
||||
#docker image rm cyphernodeconf:latest
|
||||
--rm -it cyphernodeconf:latest $recreate
|
||||
}
|
||||
|
||||
@@ -6,9 +6,13 @@
|
||||
|
||||
CONFIGURE=0
|
||||
INSTALL=0
|
||||
RECREATE=0
|
||||
|
||||
while getopts ":ci" opt; do
|
||||
while getopts ":cir" opt; do
|
||||
case $opt in
|
||||
r)
|
||||
RECREATE=1
|
||||
;;
|
||||
c)
|
||||
CONFIGURE=1
|
||||
;;
|
||||
@@ -21,12 +25,12 @@ while getopts ":ci" opt; do
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ $CONFIGURE == 0 && $INSTALL == 0 ]]; then
|
||||
echo "Please use -c to configure, -i to install and -ci to do both"
|
||||
if [[ $CONFIGURE == 0 && $INSTALL == 0 && RECREATE == 0 ]]; then
|
||||
echo "Please use -c to configure, -i to install and -ci to do both. Use -r to recreate config files."
|
||||
else
|
||||
if [[ $CONFIGURE == 1 ]]; then
|
||||
trace "Starting configuration phase"
|
||||
configure
|
||||
configure $RECREATE
|
||||
fi
|
||||
|
||||
if [[ $INSTALL == 1 ]]; then
|
||||
|
||||
Reference in New Issue
Block a user