Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
ef79e004
Commit
ef79e004
authored
Jul 11, 2013
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
intro functions-apache (for get vars from config)
parent
747f5c73
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
0 deletions
+45
-0
functions-apache
web/functions-apache
+32
-0
test-functions.sh
web/test-functions.sh
+13
-0
No files found.
web/functions-apache
0 → 100644
View file @
ef79e004
# Etersoft (c) 2013
# Sync to nginx-etersoft/apache2 and etersoft-admin-essential after change
# get one var from virtualhost config
get_var()
{
grep -i "^ *$2 " "$1" | head -n 1 | sed -e "s/^[ \t]*$2[ \t]*//g" | sed -e 's/"//g'
}
#getVar()
#{
# cat $1 | sed -e "s/^[ \t]*\(.*\)/\1/g" | grep -v "^#" | grep "^$2" | cut -f 2 -d" "
#}
# get all var values from virtualhost config
get_multivar()
{
grep -i "^ *$2 " "$1" | sed -e "s/^[ \t]*$2[ \t]*//g" | sed -e 's/"//g'
}
# returns sorted aliases list
get_aliaslist()
{
local conf=$1
local SITE=$(get_var $conf ServerName)
local techhost=$TECHHOST
[ -n "$techhost" ] || techhost="UNKNOWNTECHHOST"
# first xargs -n1 for get line by line, next xargs - for get one line output
get_multivar $conf ServerAlias | xargs -n1 echo | sort -u | grep -v "^$SITE\$" | grep -v "^www.$SITE\$" | grep -v "$techhost$" | xargs echo
}
web/test-functions.sh
0 → 100755
View file @
ef79e004
#!/bin/sh
.
./config
.
./functions-apache
get_var
$1
ServerName
get_var
$1
ServerAlias
get_var
$1
AssignUserID
echo
"==="
get_multivar
$1
ServerAlias
echo
"==="
get_aliaslist
$1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment