Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
docs:guide-user:advanced:sysupgrade_extras [2023/11/30 19:32] – [Instructions] vgaeteradocs:guide-user:advanced:sysupgrade_extras [2023/12/01 01:36] – [Instructions] minimize write operations vgaetera
Line 47: Line 47:
 local SYSUP_TYPE="$(sysupgrade_type)" local SYSUP_TYPE="$(sysupgrade_type)"
 local SYSUP_EFI="$(sysupgrade_efi)" local SYSUP_EFI="$(sysupgrade_efi)"
-local SYSUP_JSON="$(sysupgrade_json)" 
 local SYSUP_IMG="$(sysupgrade_img)" local SYSUP_IMG="$(sysupgrade_img)"
 sysupgrade "${@}" "${SYSUP_URL}/${SYSUP_IMG}" sysupgrade "${@}" "${SYSUP_URL}/${SYSUP_IMG}"
Line 102: Line 101:
 } }
  
-sysupgrade_json() {+sysupgrade_img() {
 wget -O - "${SYSUP_URL}/profiles.json" \ wget -O - "${SYSUP_URL}/profiles.json" \
-| jsonfilter -e "$['profiles']['${SYSUP_PROF}']\ +| jsonfilter -e "$['profiles']['${SYSUP_PROF}'
-['images'][@['type']='${SYSUP_TYPE}${SYSUP_EFI}'\ +['images'][@['type']='${SYSUP_TYPE}${SYSUP_EFI}' 
-&&@['filesystem']='${SYSUP_FS}']+&&@['filesystem']='${SYSUP_FS}']['name']"
-+
- +
-sysupgrade_img() { +
-jsonfilter -e "$['name']" << EOI +
-${SYSUP_JSON} +
-EOI+
 } }
  
Line 119: Line 112:
 local SVC_STATE local SVC_STATE
 for SVC_NAME in ${SVC_NAME} for SVC_NAME in ${SVC_NAME}
-do if service "${SVC_NAME}" enabled+do if command service "${SVC_NAME}" enabled
 then SVC_STATE="enable" then SVC_STATE="enable"
 else SVC_STATE="disable" else SVC_STATE="disable"
Line 128: Line 121:
 del_list system.service.disable='${SVC_NAME}' del_list system.service.disable='${SVC_NAME}'
 add_list system.service.'${SVC_STATE}'='${SVC_NAME}' add_list system.service.'${SVC_STATE}'='${SVC_NAME}'
-commit system 
 EOI EOI
 done done
 +uci commit system
 } }
  
Line 139: Line 132:
 do SVC_NAME="$(uci -q get system.service."${SVC_STATE}")" do SVC_NAME="$(uci -q get system.service."${SVC_STATE}")"
 for SVC_NAME in ${SVC_NAME} for SVC_NAME in ${SVC_NAME}
-do service "${SVC_NAME}" "${SVC_STATE}"+do command service "${SVC_NAME}" "${SVC_STATE}"
 done done
 done done
Line 150: Line 143:
 if [ ! -e /etc/service-restore ] if [ ! -e /etc/service-restore ]
 then . /etc/profile.d/sysupgrade.sh then . /etc/profile.d/sysupgrade.sh
-service restore+sysupgrade -R
 touch /etc/service-restore touch /etc/service-restore
 fi fi
  • Last modified: 2024/06/12 13:16
  • by vgaetera