|
|
@@ -1857,18 +1857,15 @@ void* ntp_thread(void *arg)
|
|
|
|
|
|
int snmp_config(SNMPManager *m)
|
|
|
{
|
|
|
- char *path_conf="/root/run/app/snmp/conf/snmpd.conf";
|
|
|
- //char *path_conf="/root/snmpd.conf";
|
|
|
+ char path[200];
|
|
|
+ char *conf="/snmp/conf/snmpd.conf";
|
|
|
char user[100],pass[200],cmd[400];
|
|
|
|
|
|
- if(strlen(m->crypt.auth.alg)<=1) {
|
|
|
- return -1;
|
|
|
- }
|
|
|
-
|
|
|
//createUser afafafaf MD5 "md5123456" DES "des123456
|
|
|
+ sys_get_path(path, conf);
|
|
|
|
|
|
//delete
|
|
|
- sprintf(cmd, "sed -e /^createUser.*$/d -e /^rouser.*$/d -i %s", path_conf);
|
|
|
+ sprintf(cmd, "sed -e /^createUser.*$/d -e /^rouser.*$/d -i %s", path);
|
|
|
system(cmd);
|
|
|
|
|
|
if(m->version==2) {
|
|
|
@@ -1879,7 +1876,7 @@ int snmp_config(SNMPManager *m)
|
|
|
strcat(pass, cmd);
|
|
|
}
|
|
|
|
|
|
- sprintf(cmd, "sed -e \"$ a %s\" -e \"$ a %s\" -i %s", pass, user, path_conf);
|
|
|
+ sprintf(cmd, "sed -e \"$ a %s\" -e \"$ a %s\" -i %s", pass, user, path);
|
|
|
system(cmd);
|
|
|
}
|
|
|
system("/etc/init.d/S90PDUApp restart snmpd");
|