File tree Expand file tree Collapse file tree 3 files changed +60
-0
lines changed
source/scripts/init/system Expand file tree Collapse file tree 3 files changed +60
-0
lines changed Original file line number Diff line number Diff line change @@ -262,6 +262,26 @@ if [ "$SYSCFG_LAN_DOMAIN" == "utopia.net" ]; then
262262 syscfg commit
263263fi
264264
265+ # Change devicetype on firmware upgrade
266+ DEVICETYPE_MIGRATE=" $( syscfg get devicetype_migrate) "
267+ if [ -z " $DEVICETYPE_MIGRATE " ]; then
268+ CURRENT_DEVICETYPE=" $( syscfg get DeviceType) "
269+ echo_t " [utopia][init] Devicetype is $CURRENT_DEVICETYPE "
270+ # When DeviceType has never been set in syscfg, CURRENT_DEVICETYPE will be empty.
271+ # Explicitly migrate empty/unset or non-PROD DeviceType values to PROD.
272+ if [ -z " $CURRENT_DEVICETYPE " ]; then
273+ echo_t " [utopia][init] DeviceType is unset or empty, migrating to PROD"
274+ syscfg set DeviceType " PROD"
275+ elif [ " $CURRENT_DEVICETYPE " != " PROD" ]; then
276+ echo_t " [utopia][init] setting DeviceType to PROD"
277+ syscfg set DeviceType " PROD"
278+ else
279+ echo_t " [utopia][init] DeviceType is already PROD, no change needed"
280+ fi
281+ syscfg set devicetype_migrate " 1"
282+ syscfg commit
283+ fi
284+
265285if [ -f $SYSCFG_OLDBKUP_FILE ]; then
266286 rm -rf $SYSCFG_OLDBKUP_FILE
267287fi
Original file line number Diff line number Diff line change @@ -204,6 +204,26 @@ if [ "$SYSCFG_LAN_DOMAIN" == "utopia.net" ]; then
204204 syscfg commit
205205fi
206206
207+ # Change devicetype on firmware upgrade
208+ DEVICETYPE_MIGRATE=" $( syscfg get devicetype_migrate) "
209+ if [ -z " $DEVICETYPE_MIGRATE " ]; then
210+ CURRENT_DEVICETYPE=" $( syscfg get DeviceType) "
211+ echo_t " [utopia][init] Devicetype is $CURRENT_DEVICETYPE " Expand commentComment on line R269Resolved
212+ # When DeviceType has never been set in syscfg, CURRENT_DEVICETYPE will be empty.
213+ # Explicitly migrate empty/unset or non-PROD DeviceType values to PROD.
214+ if [ -z " $CURRENT_DEVICETYPE " ]; then
215+ echo_t " [utopia][init] DeviceType is unset or empty, migrating to PROD"
216+ syscfg set DeviceType " PROD"
217+ elif [ " $CURRENT_DEVICETYPE " != " PROD" ]; then
218+ echo_t " [utopia][init] setting DeviceType to PROD"
219+ syscfg set DeviceType " PROD"
220+ else
221+ echo_t " [utopia][init] DeviceType is already PROD, no change needed"
222+ fi
223+ syscfg set devicetype_migrate " 1"
224+ syscfg commit
225+ fi
226+
207227# Hard Factory reset from mount-fs.sh
208228if [ ` cat /data/HFRES_UTOPIA` -eq 1 ]; then
209229 syscfg set $FACTORY_RESET_KEY $FACTORY_RESET_RGWIFI
Original file line number Diff line number Diff line change @@ -409,6 +409,26 @@ else
409409 echo " SSH: Forward SSH changed to disabled" >> $Log_file
410410fi
411411
412+ # Change devicetype on firmware upgrade
413+ DEVICETYPE_MIGRATE=" $( syscfg get devicetype_migrate) "
414+ if [ -z " $DEVICETYPE_MIGRATE " ]; then
415+ CURRENT_DEVICETYPE=" $( syscfg get DeviceType) "
416+ echo_t " [utopia][init] Devicetype is $CURRENT_DEVICETYPE " Expand commentComment on line R269Resolved
417+ # When DeviceType has never been set in syscfg, CURRENT_DEVICETYPE will be empty.
418+ # Explicitly migrate empty/unset or non-PROD DeviceType values to PROD.
419+ if [ -z " $CURRENT_DEVICETYPE " ]; then
420+ echo_t " [utopia][init] DeviceType is unset or empty, migrating to PROD"
421+ syscfg set DeviceType " PROD"
422+ elif [ " $CURRENT_DEVICETYPE " != " PROD" ]; then
423+ echo_t " [utopia][init] setting DeviceType to PROD"
424+ syscfg set DeviceType " PROD"
425+ else
426+ echo_t " [utopia][init] DeviceType is already PROD, no change needed"
427+ fi
428+ syscfg set devicetype_migrate " 1"
429+ syscfg commit
430+ fi
431+
412432# IGMP PROXY Disbaling on migration
413433IGMP_MIGRATE=" ` syscfg get igmp_migrate` "
414434if [ -z " $IGMP_MIGRATE " ]; then
You can’t perform that action at this time.
0 commit comments