Skip to content

SadPencil/sdunetd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sdunetd

Embedded SRUN3000 Portal Client for SDU-Qingdao


Ver 1.1 is suitable for Shandong University, Qingdao Campus, up to 2018.

Ver 2.0-RC is probably suitable for Shandong University, Qingdao Campus, since March 2019.

Copyright

Copyright © 2018-2019 Sad Pencil <[email protected]>

MIT License

Get the executable

Static builds are available here.

You can also compile by your self.

git clone https://github.com/SadPencil/sdunetd
cd sdunetd
go get -v
GOOS=linux GOARCH=amd64 go build

Rename the executable to sdunetd.

Generate a configuration file

Run the program without any parameters and it will guide you to create a configuration file.

./sdunetd

Installation on Linux (based on systemd)

  1. Copy the executable to /usr/local/bin, and rename it to sdunetd
  2. chmod +x /usr/local/bin/sdunetd
  3. Create a configuration file at /etc/sdunetd/config.json
  4. vi /etc/systemd/system/sdunetd.service
[Unit]
Description=sdunetd
After=network.target
Wants=network.target

[Service]
Type=simple
PrivateTmp=true
ExecStart=/usr/local/bin/sdunetd -c /etc/sdunetd/config.json -m
Restart=always

[Install]
WantedBy=multi-user.target
  1. systemctl daemon-reload
  2. systemctl enable sdunetd
  3. systemctl start sdunetd

Installation on OpenWRT

  1. Copy the executable to /usr/local/bin, and rename it to sdunetd
  • Note: You MUST choose proper builds according to /proc/cpuinfo.

  • Note: It might take a few minutes to copy a large file if squashfs is enabled on the router.

  1. chmod +x /usr/local/bin/sdunetd
  2. Create a configuration file at /etc/sdunetd/config.json
  3. touch /etc/init.d/sdunetd
  4. chmod +x /etc/init.d/sdunetd
  5. vi /etc/init.d/sdunetd
#!/bin/sh /etc/rc.common

START=60
 
start() { 
/usr/local/bin/sdunetd -c /etc/sdunetd/config.json >/dev/null 2>&1 &
}

stop() { 
killall sdunetd
}
  1. /etc/init.d/sdunetd enable
  2. /etc/init.d/sdunetd start

Installation on Windows

Although it is okay to create a shortcut at startup folder, it is better to create a service. srvany is a 32-bit program provided by Microsoft to let any program become a service, and you can get a 64-bit implementation at repo birkett/srvany-ng.

Dynamic DNS

We recommend TimothyYe/GoDNS. In the configuration file, set ip_interface to your network interface to help GoDNS get the real IPv4 address. Click here to get detailed help.

However, you can't use GoDNS behind a NAT router because the Internet traffic at SDU-Qingdao is being masqueraded, so that online services can't determine your real IPv4 address.

sdunetd is able to detect your real IPv4 address at SDU-Qingdao no matter you are under a router or not. So, if you do need this feature, open an issue at sdunetd so that we can fork a special version of GoDNS which is suitable for SDU-Qingdao.