Commit f4091537 authored by Tommy Lau's avatar Tommy Lau

Modify if statment

parent d7f5bf6f
...@@ -2,27 +2,27 @@ ...@@ -2,27 +2,27 @@
if [ ! -f /etc/ocserv/server-key.pem ] || [ -f /etc/ocserv/server-cert.pem ]; then if [ ! -f /etc/ocserv/server-key.pem ] || [ -f /etc/ocserv/server-cert.pem ]; then
# Check environment variables # Check environment variables
if [ "$CA_CN" == "" ]; then if [ -z "$CA_CN" ]; then
CA_CN="VPN CA" CA_CN="VPN CA"
fi fi
if [ "$CA_ORG" == "" ]; then if [ -z "$CA_ORG" ]; then
CA_ORG="Big Corp" CA_ORG="Big Corp"
fi fi
if [ "$CA_DAYS" == "" ]; then if [ -z "$CA_DAYS" ]; then
CA_DAYS=9999 CA_DAYS=9999
fi fi
if [ "$SRV_CN" == "" ]; then if [ -z "$SRV_CN" ]; then
SRV_CN="www.example.com" SRV_CN="www.example.com"
fi fi
if [ "$SRV_ORG" == "" ]; then if [ -z "$SRV_ORG" ]; then
SRV_ORG="MyCompany" SRV_ORG="MyCompany"
fi fi
if [ "$SRV_DAYS" == "" ]; then if [ -z "$SRV_DAYS" ]; then
SRV_DAYS=9999 SRV_DAYS=9999
fi fi
...@@ -52,7 +52,8 @@ _EOF_ ...@@ -52,7 +52,8 @@ _EOF_
certtool --generate-certificate --load-privkey server-key.pem --load-ca-certificate ca-cert.pem --load-ca-privkey ca-key.pem --template server.tmpl --outfile server-cert.pem certtool --generate-certificate --load-privkey server-key.pem --load-ca-certificate ca-cert.pem --load-ca-privkey ca-key.pem --template server.tmpl --outfile server-cert.pem
# Create a test user # Create a test user
if [[ ! $NO_TEST_USER ]] && [ -f /etc/ocserv/ocpasswd ]; then if [ -z "$NO_TEST_USER" -a -f /etc/ocserv/ocpasswd ]; then
echo "Create test user 'test' with password 'test'"
echo "test:*:$5$DktJBFKobxCFd7wN$sn.bVw8ytyAaNamO.CvgBvkzDiFR6DaHdUzcif52KK7" > /etc/ocserv/ocpasswd echo "test:*:$5$DktJBFKobxCFd7wN$sn.bVw8ytyAaNamO.CvgBvkzDiFR6DaHdUzcif52KK7" > /etc/ocserv/ocpasswd
fi fi
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment