Commit 1e68b17d authored by Jondy Zhao's avatar Jondy Zhao

fix bash default value issue

parent e36c8e95
...@@ -3,12 +3,12 @@ export PATH=/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin:$PATH ...@@ -3,12 +3,12 @@ export PATH=/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin:$PATH
function show_error_exit() function show_error_exit()
{ {
echo Error: ${1-Error: build slapos failed.} echo Error: ${1:-"build slapos failed."}
read -n 1 -p "Press any key to exit..." read -n 1 -p "Press any key to exit..."
exit 1 exit 1
} }
slapos_home=${1-/opt/slapos} slapos_home=${1:-/opt/slapos}
slapos_cache=/opt/download-cache slapos_cache=/opt/download-cache
slapos_url=http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/heads/cygwin-0:/component/slapos/buildout.cfg slapos_url=http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/heads/cygwin-0:/component/slapos/buildout.cfg
slapos_cfg=$slapos_home/buildout.cfg slapos_cfg=$slapos_home/buildout.cfg
......
...@@ -35,8 +35,8 @@ read -f slapos_kill_process ...@@ -35,8 +35,8 @@ read -f slapos_kill_process
# Declare variables # Declare variables
# #
declare -r slapos_prefix= declare -r slapos_prefix=
declare -r slapos_administrator=${slapos_prefix:slap}root declare -r slapos_administrator=${slapos_prefix:-slap}root
declare -r slapos_user_basename=${slapos_prefix:slap}user declare -r slapos_user_basename=${slapos_prefix:-slap}user
declare -r slapos_ifname=${slapos_prefix}re6stnet-lo declare -r slapos_ifname=${slapos_prefix}re6stnet-lo
declare -r re6stnet_service_name=${slapos_prefix}re6stnet declare -r re6stnet_service_name=${slapos_prefix}re6stnet
declare -r cron_service_name=${slapos_prefix}cron declare -r cron_service_name=${slapos_prefix}cron
......
...@@ -867,8 +867,8 @@ sanity_check || exit 1 ...@@ -867,8 +867,8 @@ sanity_check || exit 1
get_NT || exit 1 get_NT || exit 1
cron_service_name=${1:cron} cron_service_name=${1:-cron}
slapos_administrator=${2:slaproot} slapos_administrator=${2:-slaproot}
_password=$3 _password=$3
install_service ${slapos_administrator} ${_password} install_service ${slapos_administrator} ${_password}
......
...@@ -44,9 +44,9 @@ declare -r slapos_cron_config=/usr/bin/slapos-cron-config ...@@ -44,9 +44,9 @@ declare -r slapos_cron_config=/usr/bin/slapos-cron-config
declare -r slaprunner_startup_file=/etc/slapos/scripts/slap-runner.html declare -r slaprunner_startup_file=/etc/slapos/scripts/slap-runner.html
declare -r slapos_run_key='\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run' declare -r slapos_run_key='\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run'
declare -r slapos_run_entry=${slapos_prefix:slapos}-configure declare -r slapos_run_entry=${slapos_prefix:-slapos}-configure
declare -r slapos_administrator=${slapos_prefix:slap}root declare -r slapos_administrator=${slapos_prefix:-slap}root
declare -r slapos_user_basename=${slapos_prefix:slap}user declare -r slapos_user_basename=${slapos_prefix:-slap}user
declare -r slapos_ifname=${slapos_prefix}re6stnet-lo declare -r slapos_ifname=${slapos_prefix}re6stnet-lo
declare -r re6stnet_service_name=${slapos_prefix}re6stnet declare -r re6stnet_service_name=${slapos_prefix}re6stnet
declare -r cron_service_name=${slapos_prefix}cron declare -r cron_service_name=${slapos_prefix}cron
...@@ -183,7 +183,7 @@ function reset_slapos_connection() ...@@ -183,7 +183,7 @@ function reset_slapos_connection()
# ====================================================================== # ======================================================================
function show_error_exit() function show_error_exit()
{ {
echo ${1-Error: configure SlapOS failed.} echo ${1:-"Error: configure SlapOS failed."}
read -n 1 -p "Press any key to exit..." read -n 1 -p "Press any key to exit..."
exit 1 exit 1
} # === show_error_exit() === # } # === show_error_exit() === #
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment