Files
wlan-ap/feeds/ucentral/ucentralgw/patches/100-bash.patch
John Crispin 86b23f9ccf ucentral: development update
* fix poco build on MIPS
* add certificate generation for the gateway package
I make vlan filtering work on mt7621
* add ucentral-gateway profile
* add ubnt_edgerouter-x profiles

Signed-off-by: John Crispin <john@phrozen.org>
2021-05-04 19:16:52 +02:00

56 lines
2.3 KiB
Diff

Index: ucentralgw-2021-03-28-a42e9608/cert_scripts/clean.sh
===================================================================
--- ucentralgw-2021-03-28-a42e9608.orig/cert_scripts/clean.sh
+++ ucentralgw-2021-03-28-a42e9608/cert_scripts/clean.sh
@@ -1,3 +1,3 @@
-#!/bin/bash
+#!/bin/sh
rm *.pem *.csr
Index: ucentralgw-2021-03-28-a42e9608/cert_scripts/create_certificates.sh
===================================================================
--- ucentralgw-2021-03-28-a42e9608.orig/cert_scripts/create_certificates.sh
+++ ucentralgw-2021-03-28-a42e9608/cert_scripts/create_certificates.sh
@@ -1,15 +1,15 @@
-#!/bin/bash
+#!/bin/sh
-hn=$(hostname)
+hn=$(cat /proc/sys/kernel/hostname)
howmany=10
-cert_life=365
-subject="/C=CA/ST=British Columbia/L=Vancouver/O=Arilia Wireless/OU=Engineering/CN=$hn/emailAddress=support@example.com"
+cert_life=1825
+subject="/C=uC/ST=uCentral/L=uCentral/O=uCentral/OU=Nerdinging/CN=$hn/emailAddress=support@example.com"
-openssl genrsa -out server-key.pem 2048
-openssl req -new -key server-key.pem -subj "$subject" -out server.csr
-openssl x509 -req -days $cert_life -in server.csr -signkey server-key.pem -out server-cert.pem
+openssl genrsa -out /etc/ucentral/server-key.pem 2048
+openssl req -new -key /etc/ucentral/server-key.pem -subj "$subject" -out /etc/ucentral/server.csr
+openssl x509 -req -days $cert_life -in /etc/ucentral/server.csr -signkey /etc/ucentral/server-key.pem -out /etc/ucentral/server-cert.pem
-for i in `eval echo {1..$howmany}`
+for i in `seq 1 $howmany`
do
- openssl x509 -signkey server-key.pem -in server.csr -req -days $cert_life -out dev-$i-cert.pem
+ openssl x509 -signkey /etc/ucentral/server-key.pem -in /etc/ucentral/server.csr -req -days $cert_life -out /etc/ucentral/dev-$i-cert.pem
done
Index: ucentralgw-2021-03-28-a42e9608/cert_scripts/more_devices.sh
===================================================================
--- ucentralgw-2021-03-28-a42e9608.orig/cert_scripts/more_devices.sh
+++ ucentralgw-2021-03-28-a42e9608/cert_scripts/more_devices.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
start=11
finish=50
@@ -7,4 +7,4 @@ cert_life=365
for i in `eval echo {$start..$finish}`
do
openssl x509 -signkey server-key.pem -in server.csr -req -days $cert_life -out dev-$i-cert.pem
-done
\ No newline at end of file
+done