projects
/
carnet-upgrade.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fcb98f9
)
Handle port number in pam_radius_auth.conf.
author
Valentin Vidic
<Valentin.Vidic@CARNet.hr>
Mon, 19 Mar 2012 14:51:39 +0000
(15:51 +0100)
committer
Valentin Vidic
<Valentin.Vidic@CARNet.hr>
Mon, 19 Mar 2012 14:51:39 +0000
(15:51 +0100)
src/functions.sh
patch
|
blob
|
history
diff --git
a/src/functions.sh
b/src/functions.sh
index
0fee7ca
..
ce861a3
100644
(file)
--- a/
src/functions.sh
+++ b/
src/functions.sh
@@
-942,10
+942,10
@@
upgrade_freeradius () {
sed -n '/^[[:space:]]*client[[:space:]]\+localhost/,/^[[:space:]]*}/ { /^[[:space:]]*secret[[:space:]]*=[[:space:]]*\([^[:space:]]*\)/s//\1/p }' /etc/freeradius/clients.conf
)
if [ "$password" ] \
sed -n '/^[[:space:]]*client[[:space:]]\+localhost/,/^[[:space:]]*}/ { /^[[:space:]]*secret[[:space:]]*=[[:space:]]*\([^[:space:]]*\)/s//\1/p }' /etc/freeradius/clients.conf
)
if [ "$password" ] \
- && ! grep -q "^127.0.0.1[[:space:]]\+$password[[:space:]]\+" \
+ && ! grep -q "^127.0.0.1\(:[[:digit:]]\+\)\?[[:space:]]\+$password[[:space:]]\+" \
/etc/pam_radius_auth.conf
then
/etc/pam_radius_auth.conf
then
- sed -i.$backup_ext "s/^\(127.0.0.1[[:space:]]*\)[^[:space:]]*\(.*\)/\1$password\2/" /etc/pam_radius_auth.conf
+ sed -i.$backup_ext "s/^\(127.0.0.1\(:[[:digit:]]\+\)\?[[:space:]]\+\)[^[:space:]]\+\(.*\)/\1$password\3/" /etc/pam_radius_auth.conf
fi
fi
}
fi
fi
}