File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -138,18 +138,18 @@ else
138138 # download it
139139 wget " $SELECTED_URL " -O /tmp/companion-update.tar.gz -q --show-progress
140140
141- # extract download
141+ # extract only what we need directly to destination
142142 echo " Extracting..."
143- rm -R -f /tmp/companion-update
144- mkdir /tmp/companion-update
145- tar -xzf /tmp/companion-update.tar.gz --strip-components=1 -C /tmp/companion-update
146- rm /tmp/companion-update.tar.gz
147-
148- # copy across the useful files
149143 rm -R -f /opt/companion
150- mv /tmp/companion-update/resources /opt/companion
151- mv /tmp/companion-update/* .rules /opt/companion/ 2> /dev/null || true
152- rm -R /tmp/companion-update
144+ mkdir -p /opt/companion
145+
146+ # Extract resources directory
147+ tar -xzf /tmp/companion-update.tar.gz --strip-components=2 -C /opt/companion --wildcards ' */resources'
148+
149+ # Extract .rules files if they exist
150+ tar -xzf /tmp/companion-update.tar.gz --strip-components=1 -C /opt/companion --wildcards ' */*.rules' 2> /dev/null || true
151+
152+ rm /tmp/companion-update.tar.gz
153153
154154 echo " Finishing"
155155 else
You can’t perform that action at this time.
0 commit comments