##// END OF EJS Templates
rcstack: remove dependency for md5sum, this allows to run on macOS
super-admin -
Show More
@@ -2123,10 +2123,24 b' config_rhodecode_ini() {'
2123 # src/lib/send_completions.sh
2123 # src/lib/send_completions.sh
2124
2124
2125 # src/lib/utils.sh
2125 # src/lib/utils.sh
2126
2127 generate_md5() {
2128 local input_string="$1"
2129
2130 if command -v md5 &> /dev/null; then
2131 echo -n "$input_string" | md5
2132 elif command -v md5sum &> /dev/null; then
2133 echo -n "$input_string" | md5sum | awk '{print $1}'
2134 else
2135 echo "Error: Neither md5 nor md5sum command is available. Please make sure this is installed in your system"
2136 return 1
2137 fi
2138 }
2139
2126 random_str() {
2140 random_str() {
2127 len=$1
2141 len=$1
2128 random_generate=$(echo $RANDOM | md5sum | head -c $len)
2142 random_generate=$(generate_md5 $RANDOM | head -c $len)
2129 echo $random_generate
2143 echo "$random_generate"
2130 }
2144 }
2131
2145
2132 # function to copy files with --backup=numbered option
2146 # function to copy files with --backup=numbered option
@@ -2517,7 +2531,7 b' rcstack_init_command() {'
2517
2531
2518 bootstrap_config() {
2532 bootstrap_config() {
2519 shared_key=$(random_str 32)
2533 shared_key=$(random_str 32)
2520 shared_key_md5=$(echo $shared_key | md5sum | head -c 32)
2534 shared_key_md5=$(generate_md5 $shared_key | head -c 32)
2521 db_key=$(random_str 32)
2535 db_key=$(random_str 32)
2522
2536
2523 if [[ ! $no_prompt ]]; then
2537 if [[ ! $no_prompt ]]; then
@@ -4265,13 +4279,6 b' rcstack_init_parse_requirements() {'
4265 exit 1
4279 exit 1
4266 fi
4280 fi
4267
4281
4268 if command -v md5sum >/dev/null 2>&1; then
4269 deps['md5sum']="$(command -v md5sum | head -n1)"
4270 else
4271 printf "missing dependency: md5sum\n" >&2
4272 exit 1
4273 fi
4274
4275 if command -v find >/dev/null 2>&1; then
4282 if command -v find >/dev/null 2>&1; then
4276 deps['find']="$(command -v find | head -n1)"
4283 deps['find']="$(command -v find | head -n1)"
4277 else
4284 else
@@ -6786,7 +6793,7 b' rcstack__completions_parse_requirements() {'
6786
6793
6787 # :command.initialize
6794 # :command.initialize
6788 initialize() {
6795 initialize() {
6789 version="5.0.3"
6796 version="5.0.4"
6790 long_usage=''
6797 long_usage=''
6791 set -e
6798 set -e
6792
6799
General Comments 0
You need to be logged in to leave comments. Login now