Browse Source

add interfaces docker

master
zeus 4 years ago
parent
commit
3bec2644f8
  1. 18
      hybrid/scripts/check-wg-connection.sh
  2. 4
      llo/connect-new.js

18
hybrid/scripts/check-wg-connection.sh

@ -1,15 +1,15 @@
#!/bin/bash #!/bin/bash
declare -a wgint declare -a wgint
for fint in $(docker inspect --format '{{.HostConfig.NetworkMode}}' $(docker ps --format '{{ .Names }}') | grep "^swlab"); do #for fint in $(docker inspect --format '{{.HostConfig.NetworkMode}}' $(docker ps --format '{{ .Names }}') | grep "^swlab"); do
#echo $fint # #echo $fint
ff=$fint # ff=$fint
ff="${ff#"${ff%%[![:space:]]*}"}" # ff="${ff#"${ff%%[![:space:]]*}"}"
ff="${ff%"${ff##*[![:space:]]}"}" # ff="${ff%"${ff##*[![:space:]]}"}"
ff=${ff:5} # ff=${ff:5}
#echo $ff # #echo $ff
wgint+=($ff) # wgint+=($ff)
done #done
for f in /sys/class/net/swlab*; do for f in /sys/class/net/swlab*; do
if [ -L "$f" ]; then if [ -L "$f" ]; then
f=$(basename $f) f=$(basename $f)

4
llo/connect-new.js

@ -555,13 +555,13 @@ app.get('/getwginterfaces', (req, res, next) => {
}); });
log.stderr.on('data', function (data) { log.stderr.on('data', function (data) {
//console.log('error '+JSON.stringify(n));
RES.code = req.query["action"] RES.code = req.query["action"]
RES.token = req.query["token"] RES.token = req.query["token"]
RES.error = true RES.error = true
RES.error_msg = "no" RES.error_msg = "no"
RES.data = data.toString(); RES.data = data.toString();
res.json(RES.data) console.log('error '+JSON.stringify(RES));
//res.json(RES.data)
}); });
log.stdout.on('data', function (data) { log.stdout.on('data', function (data) {

Loading…
Cancel
Save