相信很多人和我一样,拿到小米路由玩了几天,感觉官方的步伐不够快不够激进。既然如此,何不自己动手丰衣足食呢?
首先你得知道Linux的一些基本理论,比如什么是bash
啊,cd
、ls
这些命令怎么用等等。
其次你还得知道一些编程相关的东西,因为文章专注于Node.js的编译,所以Node.js和C++的一些基本知识是要有的。
#include <stdio.h> | |
#include <unistd.h> | |
#include <net/if.h> | |
#include <arpa/inet.h> | |
#include <linux/if_ether.h> | |
#include <linux/if_tun.h> | |
#include <assert.h> | |
#include <memory.h> | |
#include <fcntl.h> | |
#include <poll.h> |
#!/bin/bash | |
function load_var { | |
eval $(cat ${1} <( echo -e '\nset -o posix;set\n') | env - bash --noprofile --norc --posix | sed 's/^/'$2'_/') | |
if [ -n "$IF_IPSEC6" ]; then | |
PEER_ENDPOINT=$PEER_ENDPOINT6 | |
SELF_ENDPOINT=$SELF_ENDPOINT6 | |
fi | |
} |