diff --git a/22.Initialize_configuration_file/0_setup.sh b/22.Initialize_configuration_file/0_setup.sh
index 5fa1281c1caecae40acdf99dbed2639a790407a7..c1ea490ee440454c546c429c22ac281c7faf57a4 100755
--- a/22.Initialize_configuration_file/0_setup.sh
+++ b/22.Initialize_configuration_file/0_setup.sh
@@ -14,13 +14,19 @@ sed -i "s@^wowza_live_pwd = .*@wowza_live_pwd = '${WOWZA_LIVE_PASSWD}'@" /root/e
 sed -i "s@^ms_server_name = .*@ms_server_name = '${MS}'@" /root/envsetup/conf.py
 sed -i "s@^ms_superuser_pwd = .*@ms_superuser_pwd = '${SUPERUSER_PWD}'@" /root/envsetup/conf.py
 sed -i "s@^ms_admin_pwd = .*@ms_admin_pwd = '${ADMIN_PWD}'@" /root/envsetup/conf.py
-MS_ID=$(echo "$(hostname)_msuser")
-MS_API=$(echo "s$(pwgen 4)-$(pwgen 5)-$(pwgen 5)-$(pwgen 5)-$(pwgen 5)")
-# respect API pattern
-MS_API=$(echo $MS_API | sed "s@[iloILO]@$((${RANDOM} / 10000))@g")
+if [ "${MS_ID}" = "" ]; then
+	MS_ID=$(echo "$(hostname)_msuser")
+fi
+if [ "${MS_API}" = "" ]; then
+	MS_API=$(echo "s$(pwgen 4)-$(pwgen 5)-$(pwgen 5)-$(pwgen 5)-$(pwgen 5)")
+	# respect API pattern
+	MS_API=$(echo $MS_API | sed "s@[iloILO]@$((${RANDOM} / 10000))@g")
+fi
+if [ "${MS_SECRET}" = "" ]; then
+	MS_SECRET=$(echo "$(pwgen 40)")
+fi
 sed -i "s@^ms_id = .*@ms_id = '${MS_ID}'@" /root/envsetup/conf.py
 sed -i "s@^ms_api_key = .*@ms_api_key = '${MS_API}'@" /root/envsetup/conf.py
-MS_SECRET=$(echo "$(pwgen 40)")
 sed -i "s@^ms_secret = .*@ms_secret = '${MS_SECRET}'@" /root/envsetup/conf.py
 # SK
 sed -i "s@^skyreach_server_name = .*@skyreach_server_name = '${CM}'@" /root/envsetup/conf.py