HEX
Server: LiteSpeed
System: Linux houston.panomity.com 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User: nudepix (1011)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //opt/resolve/scripts/script.checkfirmware
#!/bin/bash

USER=`whoami`
if [ "${USER}" != "root" ]
then
	echo "This script must be run as the super-user."
	exit 1
fi

UPDATER_BIN="/usr/bin/BlackmagicFirmwareUpdater"
if [ ! -f ${UPDATER_BIN} ]
then
	echo "No firmware updater found."
	exit 0
fi

STATUS=`${UPDATER_BIN} status | head -n 1 | awk '{print $NF}'`
CARD_NUM=0

if [ "${STATUS}" == "PLEASE_UPDATE" ]
then
	XMSG_BIN=/usr/bin/xmessage
	DO_REBOOT=0

	# Find a temporary file that we can write to
	TMP_FILE=/tmp/$$${RANDOM}.tmp
	while [ -f ${TMP_FILE} ]
	do
		TMP_FILE=/tmp/${RANDOM}.tmp
	done

	echo "The DeckLink firmware needs to be updated." > ${TMP_FILE}
	echo "The update process should not be interrupted while it is running." >> ${TMP_FILE}
	echo "The system will be rebooted after a successful update." >> ${TMP_FILE}
	echo >> ${TMP_FILE}
	echo "Please click Ok to proceed with the update." >> ${TMP_FILE}

	${XMSG_BIN} -center -buttons "Ok":0,"Cancel":1 -default "Cancel" -file ${TMP_FILE}
	if [ ${?} -eq 0 ]
	then
		# Update the DeckLink firmware
		/usr/bin/xterm -geometry 100x10 -title "DeckLink Firmware Update" -e \
			"${UPDATER_BIN} update ${CARD_NUM}; echo ${?} > ${TMP_FILE}; echo This window will be closed in 5 seconds... && sleep 5"

		RET_VAL=`cat ${TMP_FILE}`
		if [ ${RET_VAL} -eq 0 ]
		then
			echo "The DeckLink firmware was successfully updated." > ${TMP_FILE}
			echo "The system needs to be rebooted before it can be used." >> ${TMP_FILE}

			${XMSG_BIN} -center -buttons "Reboot now":0,"Reboot later":1 -default "Reboot now" -file ${TMP_FILE} \
				&& DO_REBOOT=1
		else
			${XMSG_BIN} -center -buttons "Ok":0 "The DeckLink firmware update failed (Return code: ${RET_VAL})."
		fi
	fi

	\rm -f ${TMP_FILE}

	if [ ${DO_REBOOT} -eq 1 ]
	then
		/usr/bin/reboot
	fi
fi

exit 0