login.sh logs in to the lab network gateway without requiring Python.
/bin/shawkcurlorwget
These tools are available on most default Linux installations. If both curl
and wget are missing, install one of them before running the script.
Set credentials in the environment:
export LAB_NET_USER='your-user'
export LAB_NET_PWD='your-password'
./login.shOr use the default config file:
mkdir -p ~/.config/lab-login
cat > ~/.config/lab-login/env <<'EOF'
LAB_NET_USER='your-user'
LAB_NET_PWD='your-password'
EOF
chmod 600 ~/.config/lab-login/env
./login.shThe config file must not be readable or writable by group or others on Linux.
LAB_LOGIN_CONFIG: config file path. Default:~/.config/lab-login/envLAB_LOGIN_LOG_DIR: log directory. Default:~/.scripts/.log/loginLAB_LOGIN_URL: gateway login URL. Default:http://1.1.1.3/ac_portal/login.phpLAB_LOGIN_CONNECT_TEST_URL: connectivity check URL.
Run the built-in RC4 test:
sh login.sh --self-testInstall as a system service that runs once after boot and then every 5 minutes:
sudo ./install-systemd.sh installThe installer asks for your lab network username and password, writes them to
/etc/lab-login/env, enables the timer, and starts one immediate login check.
For non-interactive install:
sudo LAB_NET_USER='your-user' LAB_NET_PWD='your-password' ./install-systemd.sh installThe installer creates:
/usr/local/bin/lab-login/etc/lab-login/env/etc/systemd/system/lab-login.service/etc/systemd/system/lab-login.timer/var/log/lab-login
If /etc/lab-login/env already exists, it is preserved. You can edit it later:
sudo sh -c 'umask 077; vi /etc/lab-login/env'
sudo systemctl restart lab-login.timerCheck status:
systemctl status lab-login.timer lab-login.service
journalctl -u lab-login.service -n 100 --no-pagerUninstall the timer and service:
sudo ./install-systemd.sh uninstall