mirror of
https://github.com/lakinduakash/linux-wifi-hotspot.git
synced 2024-11-21 19:40:11 +00:00
Now config file is always writen to /etc/wh.config
This commit is contained in:
parent
c399af64f9
commit
48d6928233
@ -98,7 +98,7 @@ const char *build_wh_mkconfig_command(ConfigValues* cv){
|
||||
|
||||
const char* a=get_config_file(CONFIG_FILE_NAME);
|
||||
|
||||
snprintf(cmd_mkconfig, BUFSIZE, "%s %s %s %s %s %s %s", CREATE_AP, cv->iface_wifi, cv->iface_inet, cv->ssid, cv->pass,MKCONFIG,a);
|
||||
snprintf(cmd_mkconfig, BUFSIZE, "%s %s %s %s %s %s %s %s",SUDO, CREATE_AP, cv->iface_wifi, cv->iface_inet, cv->ssid, cv->pass,MKCONFIG,a);
|
||||
|
||||
if(cv->freq!=NULL){
|
||||
strcat(cmd_mkconfig," --freq-band ");
|
||||
@ -184,7 +184,7 @@ const char* build_kill_create_ap_command(char* pid){
|
||||
|
||||
static int init_get_running(){
|
||||
|
||||
const char* cmd="create_ap --list-running";
|
||||
const char* cmd="pkexec --user root create_ap --list-running";
|
||||
FILE *fp;
|
||||
|
||||
if ((fp = popen(cmd, "r")) == NULL) {
|
||||
|
@ -124,12 +124,13 @@ const char* get_config_file(const char* file){
|
||||
|
||||
static char a[BUFSIZE];
|
||||
|
||||
if ((homedir = getenv("HOME")) == nullptr) {
|
||||
homedir = getpwuid(getuid())->pw_dir;
|
||||
}
|
||||
snprintf(a,BUFSIZE,"%s%s%s",homedir,"/",file);
|
||||
// if ((homedir = getenv("HOME")) == nullptr) {
|
||||
// homedir = getpwuid(getuid())->pw_dir;
|
||||
// }
|
||||
// snprintf(a,BUFSIZE,"%s%s%s",homedir,"/",file);
|
||||
|
||||
snprintf(a,BUFSIZE,"%s",file);
|
||||
|
||||
//printf(" from %s \n",a);
|
||||
return (const char*)a;
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
|
||||
#define CONFIG_FILE_NAME ".wh.config"
|
||||
#define CONFIG_FILE_NAME "/etc/wh.config"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
Loading…
Reference in New Issue
Block a user