Skip to content

Commit 86bb44d

Browse files
committed
Move getent() from hostname.sh to openwrt section of functions.sh
1 parent 7b31b66 commit 86bb44d

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

lib/functions.sh

+8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ f() { find . -type f -iname '*'$*'*'; }
55

66
if [[ $OSTYP == openwrt ]]; then
77
sc() { $SUDO /etc/init.d/$2 $1; }
8+
function getent
9+
{
10+
if [[ $1 == passwd ]]; then
11+
cat /etc/passwd
12+
elif [[ $1 == group ]]; then
13+
cat /etc/group
14+
fi
15+
}
816
elif [[ $OSTYP == alpine ]]; then
917
sc() {
1018
if [[ $1 == enable ]]; then

lib/hostname.sh

-10
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,6 @@ get_fqdn() {
2929
echo "$fqdn"
3030
}
3131

32-
# Function to simulate getent calls on OpenWrt
33-
function getent
34-
{
35-
if [[ $1 == passwd ]]; then
36-
cat /etc/passwd
37-
elif [[ $1 == group ]]; then
38-
cat /etc/group
39-
fi
40-
}
41-
4232
# Overwrite the hostname command to have a consistent response!
4333
hostname () {
4434

0 commit comments

Comments
 (0)