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/whisper-gui/scripts/config_write.py
import json
import sys
import os

def main(key, value):
	config_file = os.path.join("configs", "config.json")

	# Check if the config.json file exists
	if not os.path.exists(config_file):
		sys.exit(1)

	# Read the existing data
	try:
		with open(config_file, 'r') as file:
			try:
				data = json.load(file)
			except json.JSONDecodeError:
				# File is empty, create a new dictionary
				data = {}
	except IOError as e:
		sys.exit(1)

	value = str(value).lower()
	if value == "true": value = True
	elif value == "false": value = False
	elif value == "null": value = None
	data[key] = value

	# Write the updated data
	try:
		with open(config_file, 'w') as file:
			json.dump(data, file, indent=4)
	except IOError as e:
		print(f"Error writing to file: {e}")
		sys.exit(1)

	sys.exit(0)

if __name__ == "__main__":
	if len(sys.argv) != 3:
		sys.exit(1)

	input_key = sys.argv[1]
	input_value = sys.argv[2]

	main(input_key, input_value)