]> infiniteadaptability.org Git - cold/commitdiff
... master
authoralex <[email protected]>
Sat, 16 Jul 2022 05:35:53 +0000 (22:35 -0700)
committeralex <[email protected]>
Sat, 16 Jul 2022 05:35:53 +0000 (22:35 -0700)
cold-setup

index e161b40034c8fa808f2cdaaafd77e58537fc5064..45167aa8e28299ee933a968482130835a32e7d34 100755 (executable)
@@ -15,6 +15,7 @@ M=3
 N=7
 
 # variables used in usb functions
+PASSPHRASE=
 USB_DECRYPT_NAME="cold-usb"
 USB_PATH=
 USB_PATH_PRE_DECRYPT=
@@ -59,6 +60,12 @@ bitcoin_core_stop_interactive() {
        log_msg "stop bitcoin core:\n\n\tbitcoin-cli stop\n"
 }
 
+check() {
+       local UUIDS=()
+       log_error "not implemented\n"
+       exit 1
+}
+
 confirm() {
        local RESULT
        while true; do
@@ -198,6 +205,7 @@ parse_arguments() {
        for arg in "$@"; do
                shift
                case "$arg" in
+                       "--check") set -- "$@" "-c" ;;
                        "--help") set -- "$@" "-h" ;;
                        "--interactive") set -- "$@" "-i" ;;
                        "--no-encryption") set -- "$@" "-p" ;;
@@ -209,9 +217,10 @@ parse_arguments() {
 
        # parse short options
        OPTIND=1
-       while getopts "hm:n:ip" opt
+       while getopts "chm:n:ip" opt
        do
                case "$opt" in
+                       "c") set_mode "check" ;;
                        "h") usage ;;
                        "i") set_mode "interactive" ;;
                        "m") set_threshold "$OPTARG" ;;
@@ -235,6 +244,7 @@ set_encryption() {
 
 set_mode() {
        case "$1" in
+               "check") MODE="check" ;;
                "interactive") MODE="interactive" ;;
                *)
                        log_error "ERROR: unknown mode \"$1\""
@@ -599,10 +609,19 @@ main() {
 
        validate_parameters
 
-       if [[ "$MODE" == "interactive" ]]; then
-               main_interactive
-               exit
-       fi
+       case "$MODE" in
+               "check")
+                       check
+                       exit
+                       ;;
+               "interactive")
+                       main_interactive
+                       exit
+                       ;;
+       esac
+
+       echo "here"
+       exit 1
 
        bitcoin_core_start