diff --git a/source/scripts/init/system/utopia_init.sh b/source/scripts/init/system/utopia_init.sh index fca35332..e3f21581 100755 --- a/source/scripts/init/system/utopia_init.sh +++ b/source/scripts/init/system/utopia_init.sh @@ -262,6 +262,23 @@ if [ "$SYSCFG_LAN_DOMAIN" == "utopia.net" ]; then syscfg commit fi +#Change devicetype on firmware udgrade +DEVICETYPE_MIGRATE="$(syscfg get devicetype_migrate)" +echo "$DEVICETYPE_MIGRATE" +if [ -z "$DEVICETYPE_MIGRATE" ]; then + CURRENT_DEVICETYPE="$(syscfg get DeviceType)" + echo "[utopia] Devicetype is $CURRENT_DEVICETYPE" + if [ "$CURRENT_DEVICETYPE" != "PROD" ]; then + echo "setting DeviceType to PROD" + syscfg set DeviceType "PROD" + syscfg commit + else + echo "DeviceType is already PROD, no change needed" + fi + syscfg set devicetype_migrate "1" + syscfg commit +fi + if [ -f $SYSCFG_OLDBKUP_FILE ];then rm -rf $SYSCFG_OLDBKUP_FILE fi diff --git a/source/scripts/init/system/utopia_init_hub4.sh b/source/scripts/init/system/utopia_init_hub4.sh index 9239aa45..9a85b201 100755 --- a/source/scripts/init/system/utopia_init_hub4.sh +++ b/source/scripts/init/system/utopia_init_hub4.sh @@ -204,6 +204,23 @@ if [ "$SYSCFG_LAN_DOMAIN" == "utopia.net" ]; then syscfg commit fi +#Change devicetype on firmware udgrade +DEVICETYPE_MIGRATE="$(syscfg get devicetype_migrate)" +echo "$DEVICETYPE_MIGRATE" +if [ -z "$DEVICETYPE_MIGRATE" ]; then + CURRENT_DEVICETYPE="$(syscfg get DeviceType)" + echo "[utopia] Devicetype is $CURRENT_DEVICETYPE" + if [ "$CURRENT_DEVICETYPE" != "PROD" ]; then + echo "setting DeviceType to PROD" + syscfg set DeviceType "PROD" + syscfg commit + else + echo "DeviceType is already PROD, no change needed" + fi + syscfg set devicetype_migrate "1" + syscfg commit +fi + #Hard Factory reset from mount-fs.sh if [ `cat /data/HFRES_UTOPIA` -eq 1 ]; then syscfg set $FACTORY_RESET_KEY $FACTORY_RESET_RGWIFI diff --git a/source/scripts/init/system/utopia_init_xb6.sh b/source/scripts/init/system/utopia_init_xb6.sh index f21e3c78..ba4d0700 100755 --- a/source/scripts/init/system/utopia_init_xb6.sh +++ b/source/scripts/init/system/utopia_init_xb6.sh @@ -409,6 +409,23 @@ else echo "SSH: Forward SSH changed to disabled" >> $Log_file fi +#Change devicetype on firmware udgrade +DEVICETYPE_MIGRATE="$(syscfg get devicetype_migrate)" +echo "$DEVICETYPE_MIGRATE" +if [ -z "$DEVICETYPE_MIGRATE" ]; then + CURRENT_DEVICETYPE="$(syscfg get DeviceType)" + echo "[Utopia] Devicetype is $CURRENT_DEVICETYPE" + if [ "$CURRENT_DEVICETYPE" != "PROD" ]; then + echo "setting DeviceType to PROD" + syscfg set DeviceType "PROD" + syscfg commit + else + echo "DeviceType is already PROD, no change needed" + fi + syscfg set devicetype_migrate "1" + syscfg commit +fi + #IGMP PROXY Disbaling on migration IGMP_MIGRATE="`syscfg get igmp_migrate`" if [ -z "$IGMP_MIGRATE" ]; then