Community discussions

MikroTik App
 
DuMbh3aD
just joined
Topic Author
Posts: 3
Joined: Thu Jan 19, 2017 11:16 pm

PPP Profile scripts

Thu Feb 10, 2022 9:54 am

Hi, I'm new to scripts. I made a mistake somewhere, but I don't know where.

PPP Profile Script On Up:
:local DateTime ([/system clock get date] . " - " . [/system clock get time] . "   ");
:local PPPProfileFile [/file get flash/PPPProfile.txt contents];
:local PPPProfileLog ($DateTime . $user . " connect with private IP address " . $"remote-address" . " from " . $"caller-id");
:set PPPProfileFile ($PPPProfileFile . "\r\n" . $PPPProfileLog);
/file set flash/PPPProfile.txt contents=$PPPProfileFile;
PPP Profile Script On Down:
:local UserUpTime [/interface pptp-server get $interface uptime];
:local DateTime ([/system clock get date] . " - " . [/system clock get time] . "   ");
:local PPPProfileFile [/file get flash/PPPProfile.txt contents];
:local PPPProfileLog ($DateTime . $user . " disconnect. Uptime connection - " . $UserUpTime);
:set PPPProfileFile ($PPPProfileFile . "\r\n" . $PPPProfileLog);
/file set flash/PPPProfile.txt contents=$PPPProfileFile;
Does not save the users uptime in the file. Can you show me where I went wrong?

Who is online

Users browsing this forum: No registered users and 16 guests