Project

General

Profile

« Previous | Next » 

Revision c1367bd1

Added by Renato Botelho almost 10 years ago

Fix path for pre and post upgrade scripts

View differences:

etc/rc.firmware
253 253
		cp /boot/loader.conf.local /tmp/$GLABEL_SLICE/boot/loader.conf.local
254 254
	fi
255 255

  
256
	# If /tmp/$GLABEL_SLICE/tmp/post_upgrade_command exists
256
	# If /tmp/$GLABEL_SLICE/usr/local/share/pfSense/post_upgrade_command exists
257 257
	# after update then execute the command.
258 258
	echo "Checking for post_upgrade_command..." >> /conf/upgrade_log.txt
259
	if [ -f /tmp/$GLABEL_SLICE/tmp/post_upgrade_command ]; then
259
	if [ -f /tmp/$GLABEL_SLICE/usr/local/share/pfSense/post_upgrade_command ]; then
260 260
		echo "Found post_upgrade_command, executing ($GLABEL_SLICE)..." >> /conf/upgrade_log.txt
261
		sh /tmp/$GLABEL_SLICE/tmp/post_upgrade_command $GLABEL_SLICE >> /conf/upgrade_log.txt 2>&1
261
		sh /tmp/$GLABEL_SLICE/usr/local/share/pfSense/post_upgrade_command $GLABEL_SLICE >> /conf/upgrade_log.txt 2>&1
262 262
	fi
263 263

  
264 264
	# Update fstab
......
371 371
	remove_chflags
372 372

  
373 373
	# Do we have a pre-upgrade hook in the update file?
374
	if [ `tar tvzf $IMG | grep /tmp/pre_upgrade_command | wc -l` -gt 0 ]; then
375
		tar xzvf $IMG -C / ./tmp/pre_upgrade_command >> /conf/upgrade_log.txt 2>&1
376
		chmod a+rx /tmp/pre_upgrade_command >> /conf/upgrade_log.txt 2>&1
377
		sh /tmp/pre_upgrade_command >> /conf/upgrade_log.txt 2>&1
374
	if [ `tar tvzf $IMG | grep /usr/local/share/pfSense/pre_upgrade_command | wc -l` -gt 0 ]; then
375
		tar xzvf $IMG -C / ./usr/local/share/pfSense/pre_upgrade_command >> /conf/upgrade_log.txt 2>&1
376
		chmod a+rx /usr/local/share/pfSense/pre_upgrade_command >> /conf/upgrade_log.txt 2>&1
377
		sh /usr/local/share/pfSense/pre_upgrade_command >> /conf/upgrade_log.txt 2>&1
378 378
	fi
379 379

  
380 380
	echo "Firmware upgrade in progress..." >> /conf/upgrade_log.txt 2>&1
......
431 431
	# Remove saved commit ID for gitsync
432 432
	rm -f /etc/version.gitsync
433 433

  
434
	# If /tmp/post_upgrade_command exists after update
434
	# If /usr/local/share/pfSense/post_upgrade_command exists after update
435 435
	# then execute the command.
436
	if [ -f /tmp/post_upgrade_command ]; then
437
		if [ ! -x /tmp/post_upgrade_command ]; then
438
			chmod ug+x /tmp/post_upgrade_command
436
	if [ -f /usr/local/share/pfSense/post_upgrade_command ]; then
437
		if [ ! -x /usr/local/share/pfSense/post_upgrade_command ]; then
438
			chmod ug+x /usr/local/share/pfSense/post_upgrade_command
439 439
		fi
440
		/tmp/post_upgrade_command >> /conf/upgrade_log.txt 2>&1
440
		/usr/local/share/pfSense/post_upgrade_command >> /conf/upgrade_log.txt 2>&1
441 441
	fi
442 442

  
443 443
	# remove unused files

Also available in: Unified diff