Ejemplo n.º 1
0
void restart_aria(void)
{
	int is_run_before = is_aria_run();
	int is_run_after;

	stop_aria();
	if (count_sddev_mountpoint())
		run_aria();

	is_run_after = is_aria_run();

	if ((is_run_after != is_run_before) && nvram_match("fw_enable_x", "1"))
		restart_firewall();
}
Ejemplo n.º 2
0
void
start_usb_apps(void)
{
	int need_restart_fw = 0;

#if defined(APP_FTPD)
	run_ftp();
	if (nvram_match("ftpd_wopen", "1"))
		need_restart_fw |= is_ftp_run();
#endif
#if defined(APP_SMBD)
	run_samba();
#endif
#if defined(APP_NFSD)
	run_nfsd();
#endif
#if defined(APP_MINIDLNA)
	run_dms(0);
#endif
#if defined(APP_FIREFLY)
	run_itunes();
#endif
#if defined(APP_TRMD)
	run_torrent();
	need_restart_fw |= is_torrent_run();
#endif
#if defined(APP_ARIA)
	run_aria();
	need_restart_fw |= is_aria_run();
#endif

	if (need_restart_fw && nvram_match("fw_enable_x", "1"))
		restart_firewall();
}
Ejemplo n.º 3
0
void stop_aria(void)
{
	if (!is_aria_support())
		return;

	if (!is_aria_run())
		return;

	eval("/usr/bin/aria.sh", "stop");
}
Ejemplo n.º 4
0
void run_aria(void)
{
	char *apps_name = "Aria";
	char *link_path = "/mnt/aria";
	char *dest_dir = "aria";

	if (!nvram_match("aria_enable", "1"))
		return;

	if (!is_aria_support())
		return;

	if (is_aria_run())
		return;

	unlink(link_path);
	if (!create_mp_link(dest_dir, link_path, 0)) {
		logmessage(apps_name, "Cannot start: please create dir \"%s\" on target volume!", dest_dir);
		return;
	}

	eval("/usr/bin/aria.sh", "start");
}