Skip to main content

dgut-inet-auth

Log in to Dongguan University of Technologies campus internet.

Installation

$ pip install -U dgut-inet-auth

Usage

Create a config file with this structure

your user id
your password

Then run

$ dgut-inet-auth <config file>

Return values:

  • Exit code 0, json output: successfully logged in.
  • Exit code 0, no output: already authenticated, skip.
  • Exit code 1: network is unreachable.

You can optionally configure the firewall mark this program uses with a FWMARK environment variable to work with policy routing.

Use with systemd

Create service unit:

# /etc/systemd/system/dgut-inet-auth.service
[Unit]
After=network.target
Description=DGUT campus internet authentication

[Service]
ExecStart=dgut-inet-auth /path/to/dgut-inet-auth.conf
Type=oneshot

Create timer unit:

# /etc/systemd/system/dgut-inet-auth.timer
[Unit]
Description=Auto authentication for DGUT campus internet

[Timer]
OnCalendar=minutely

[Install]
WantedBy = timers.target

Enable systemd timer

# systemctl daemon-reload
# systemctl enable --now dgut-inet-auth.timer

Use with Nix flakes

{
  inputs.dgut-inet-auth.url = "github:chuangzhu/dgut-inet-auth";
  outputs = { self, nixpkgs, dgut-inet-auth }: {
    # Replace your-host-name to your machine
    nixosConfigurations.your-host-name = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [
        dgut-inet-auth.nixosModules.dgut-inet-auth
        {
          services.dgut-inet-auth.enable = true;
          # Specify your config file here
          services.dgut-inet-auth.configPath = ./dgut-inet-auth-config-file;
        }
      ];
    };
  };
}
  • services.dgut-inet-auth.enable: enable systemd timer for auto authentication.
  • services.dgut-inet-auth.configPath: config file location.
  • services.dgut-inet-auth.checkInterval: systemd.time(7) expression for timer interval.

Release files for dgut-inet-auth 0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dgut-inet-auth 0.3
File Size Uploaded
dgut-inet-auth-0.3.tar.gz 3.5 kB Details

Release files / dgut-inet-auth-0.3.tar.gz

Download URL dgut-inet-auth-0.3.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
657f4094818a52f8e5d7fe27b538c48cc82563de6de39d6aec5ed92e924ee2cf
BLAKE2b-256 checksum
How to use checksums
7c0494168bf4a64dbdbe6b26cf8ac75eb1e43c4d6173652afbf2c557a0a723a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release history Release notifications | RSS feed

This release

0.3 This release

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page