diff --git a/release/src-rt-6.x.4708/router/rc/mysql.c b/release/src-rt-6.x.4708/router/rc/mysql.c index 06c6de5e3a..c94d4d1c59 100644 --- a/release/src-rt-6.x.4708/router/rc/mysql.c +++ b/release/src-rt-6.x.4708/router/rc/mysql.c @@ -2,6 +2,7 @@ * mysql.c * * Copyright (C) 2014 bwq518, Hyzoom + * Fixes/updates (C) 2018 - 2022 pedro * */ @@ -22,7 +23,7 @@ #define MYSQL_ANYHOST "/tmp/setanyhost.sql" -void start_mysql(void) +void start_mysql(int force) { FILE *fp; char pbi[128]; @@ -34,11 +35,11 @@ void start_mysql(void) /* make sure its really stop */ stop_mysql(); - /* only if enabled... */ - if (!nvram_match("mysql_enable", "1")) + /* only if enabled or forced */ + if (!nvram_get_int("mysql_enable") && force == 0) return; - if (nvram_match( "mysql_binary", "internal")) + if (nvram_match("mysql_binary", "internal")) strcpy(pbi, "/usr/bin"); else if (nvram_match("mysql_binary", "optware")) strcpy(pbi, "/opt/bin"); @@ -47,6 +48,7 @@ void start_mysql(void) if (pbi[strlen(pbi)-1] == '/') pbi[strlen(pbi) - 1] = '\0'; + splitpath(pbi, basedir, tmp1); /* Generate download saved path based on USB partition (mysql_dlroot) and directory name (mysql_datadir) */ diff --git a/release/src-rt-6.x.4708/router/rc/rc.h b/release/src-rt-6.x.4708/router/rc/rc.h index 19c5a62631..abbccf4a3c 100644 --- a/release/src-rt-6.x.4708/router/rc/rc.h +++ b/release/src-rt-6.x.4708/router/rc/rc.h @@ -584,7 +584,7 @@ extern void start_nginx(); extern void stop_nginx(); extern void start_nginxfp(); extern void stop_nginxfp(); -extern void start_mysql(); +extern void start_mysql(int force); extern void stop_mysql(); #endif diff --git a/release/src-rt-6.x.4708/router/rc/services.c b/release/src-rt-6.x.4708/router/rc/services.c index a38b41dc58..fc2c9d4163 100644 --- a/release/src-rt-6.x.4708/router/rc/services.c +++ b/release/src-rt-6.x.4708/router/rc/services.c @@ -3233,7 +3233,7 @@ void start_services(void) start_httpd(); #ifdef TCONFIG_NGINX start_nginx(); - start_mysql(); + start_mysql(0); #endif start_cron(); start_rstats(0); @@ -4097,11 +4097,16 @@ TOP: if (act_start) start_nginxfp(); goto CLEAR; } - if (strcmp(service, "mysql") == 0) { + if (strncmp(service, "mysql", 5) == 0) { if (act_stop) stop_mysql(); stop_firewall(); start_firewall(); /* always restarted */ - if (act_start) start_mysql(); + if (act_start) { + if (!(strcmp(service, "mysqlgui") == 0)) /* force (re)start */ + start_mysql(1); + else + start_mysql(0); + } goto CLEAR; } #endif diff --git a/release/src-rt-6.x.4708/router/www/at.css b/release/src-rt-6.x.4708/router/www/at.css index 097ba2a6cc..b7e44a71e6 100644 --- a/release/src-rt-6.x.4708/router/www/at.css +++ b/release/src-rt-6.x.4708/router/www/at.css @@ -2002,8 +2002,9 @@ table.fields tr td.wwan-parser-view { margin-bottom: 20px; } -#_nginxfp_button { - margin-left: 45px; +#_nginxfp_button, +#_mysql_button { + margin-left: 54px; } textarea.as-script { diff --git a/release/src-rt-6.x.4708/router/www/isup.jsx b/release/src-rt-6.x.4708/router/www/isup.jsx index 8bd9ac23ed..9a8d246c10 100644 --- a/release/src-rt-6.x.4708/router/www/isup.jsx +++ b/release/src-rt-6.x.4708/router/www/isup.jsx @@ -35,6 +35,7 @@ isup.pptpd = parseInt('<% psup("pptpd"); %>'); /* NGINX-BEGIN */ isup.nginx = parseInt('<% psup("nginx"); %>'); +isup.mysqld = parseInt('<% psup("mysqld"); %>'); /* NGINX-END */ /* SSH-BEGIN */ diff --git a/release/src-rt-6.x.4708/router/www/web-mysql.asp b/release/src-rt-6.x.4708/router/www/web-mysql.asp index 4f0691f6b1..70bd6fe6b7 100644 --- a/release/src-rt-6.x.4708/router/www/web-mysql.asp +++ b/release/src-rt-6.x.4708/router/www/web-mysql.asp @@ -21,9 +21,49 @@ // <% usbdevices(); %> -var ams_link = '  [Click here to manage MySQL]<\/i><\/a>'; + + + + @@ -170,8 +221,9 @@ function init() { - - + + + @@ -181,13 +233,23 @@ function init() { +
Status
+
+
+ + +
+
+ + +
Basic Settings
+