fix: yum install failed for centos like.

This commit is contained in:
Daniel Ding
2022-11-19 11:59:53 +08:00
parent a6cfe7a56a
commit 8e4d541cfe
6 changed files with 56 additions and 53 deletions

View File

@@ -1,4 +1,4 @@
# --- point.cfg ---
# This file define the configuration for OpenLAN Point.
OPTIONS='-log:file /dev/null -terminal off -cacert /etc/openlan/ca-trusted.crt'
OPTIONS='-log:file /dev/null -terminal off'

View File

@@ -12,11 +12,12 @@ function download() {
}
function requires() {
local os=$(cat /etc/os-release | grep ^ID= | sed 's/"//g')
if echo $os | grep -q -e centos -e redhat; then
yum install -y net-tools iptables iputils openvpn openssl11 openvswitch dnsmasq
elif echo $os | grep -q -e debian -e ubuntu; then
apt-get install -y net-tools iptables iproute2 openvpn openssl openvswitch-switch dnsmasq
if type yum > /dev/null; then
yum install -y net-tools iptables iputils openvpn openvswitch dnsmasq
elif type apt > /dev/null; then
apt-get install -y net-tools iptables iproute2 openvpn openvswitch-switch dnsmasq
else
echo "We didn't find yum and apt."
fi
}

View File

@@ -9,8 +9,10 @@ import (
func TestSwitch_LoadPass(t *testing.T) {
sw := &Switch{}
sw.LoadPass("../../.password.no")
sw.LoadPass("../../packaging/resource/password.example")
cache.User.SetFile("../../.password.no")
sw.LoadPass()
cache.User.SetFile("../../packaging/resource/password.example")
sw.LoadPass()
for user := range cache.User.List() {
if user == nil {
break