Help using procd (for login to ISP portal)

Hello

I'm using the latest version of openwrt with sysupdate by Hnyman on my netgear r7800.

I'm trying to use procd to connect to my public wifi service provider, which has a portal embbeded as the picture below.

For that it seems I have to create a script that will monitor the connection on the background.
I've searched for some tutorials about procd and how to make additional scripts run on my netgear but I couldn't find any.

Does anyone has a step by step tutorial, or can provide some quick instruction/context on how to make it run inside the netgear?

Apologies for my ignorance on this theme, I'm a beginner with it.

Here's an example of the script I'd need to run (found it on the web), on this case he was using wget with SSL support, but on the literature wget was replaced by procd..

#!/bin/sh

wget -qO- --output-document=blank_page.html --no-check-certificate --save-cookies=cookie --keep-session-cookies http://www.google.com/blank.html

if (cat blank_page.html | grep -q -i "proximus"); then
   POST_ACTION=$(cat blank_page.html | grep -i 'action="https://proximus' | cut -d \" -f 4)

echo $POST_ACTION;

   if [ -n "$POST_ACTION" ]; then
      wget -qO- --output-document=return.html --no-check-certificate --load-cookies=cookie --keep-session-cookies --post-data="UserName=XXXXXXXXXXXX&Password=XXXXXXXXX&rememberMe=true&_rememberMe=on&login=Login" $POST_ACTION
      if (cat return.html | grep -q -i "success"); then
         logger "FON-network: Login successfull"
      else
         logger "FON-network: Login failed"
      fi
      rm return.html
   else
      logger "FON-network: Unable to get post url"

   fi
fi
rm cookie blank_page.html

Look for a package called "travelmate", it is designed to solve this scenario.

2 Likes

procd is the system service launch & control daemon.
Doesn't sound like a correct tool for your need of a captive portal login.

Travelmate, like eduperez already said, might be better suited for the task.

Thank you all, I'm already on the way with it..
I have 2 questions,

  • What is the difference between the packages under /packages-19.07/x86_64/packages/ and /snapshots/packages/x86_64/packages/ ?? Which one should I use with Hnyman firmware?
  • Also I installed the sysupgrade from hnyman, if I reset openwrt firmware, will it return back with the sysupgrade, or should I install the sysupgrade again?

Packages are either for the 19.07 release branch firmware or for master branch firmwares.

Neither.
Both of those addresses are for x86_64, which is quite different as architecture than the one in R7800.

Just use the opkg commands to fetch suitable packages.

opkg update
opkg install luci-app-travelmate

After reset all settings and add-on packages are cleared, and you start from a clean situation, just like after a sysupgrade without settings. No need for a new sysupgrade.

1 Like

Thanks,

Not surprisingly it requires a connection already, but I took this neat log and I suppose I can download them to a local drive, and install them without connection if I need to reset the firmware to a fresh status

Funny, I tried luci-app-travelmate found in https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/luci/ - the address he tried to update packages from
But it says the architecture is not compatible.
When I tried to install the one in x86_x64 it went trough without problems.. am I missing something? Or is it possible I installed the wrong firmware?

You are using the "master" branch firmware for R7800, so packages from that arm_cortex-a15_neon-vfpv4 should be ok.

Possibly you just happened to try it while the OpenWrt buildbot was uploading the next build, or something like that. Build log:
http://buildbot.openwrt.org/master/packages/builders/arm_cortex-a15_neon-vfpv4

Works quite ok for me right now.

 OpenWrt SNAPSHOT, r14985-4d4ef1058c
 -----------------------------------------------------
root@router1:~# opkg update
Downloading https://downloads.openwrt.org/snapshots/targets/ipq806x/generic/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_core
Downloading https://downloads.openwrt.org/snapshots/targets/ipq806x/generic/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_base
Downloading https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/luci/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_luci
Downloading https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/luci/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_packages
Downloading https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/routing/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_routing
Downloading https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/routing/Packages.sig
Signature check passed.

root@router1:~# opkg install luci-app-travelmate
Installing luci-app-travelmate (git-20.271.68662-bb40b8e) to root...
Downloading https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/luci/luci-app-travelmate_git-20.271.68662-bb40b8e_all.ipk
Installing travelmate (2.0.2-3) to root...
Downloading https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/packages/travelmate_2.0.2-3_all.ipk
Configuring travelmate.
Configuring luci-app-travelmate.

Download works also manually:

root@router1:~# wget https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/packages/travelmate_2.0.2-3_all.ipk
--2020-11-22 16:15:25--  https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/packages/travelmate_2.0.2-3_all.ipk
Resolving downloads.openwrt.org... 2a01:4f8:251:321::2, 168.119.138.211
Connecting to downloads.openwrt.org|2a01:4f8:251:321::2|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14091 (14K) [application/octet-stream]
Saving to: 'travelmate_2.0.2-3_all.ipk'

travelmate_2.0.2-3_all.ipk 100%[======================================>]  13.76K  --.-KB/s    in 0s

2020-11-22 16:15:25 (86.5 MB/s) - 'travelmate_2.0.2-3_all.ipk' saved [14091/14091]