mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-05-07 20:25:55 +02:00
Merge pull request #224 from usmannasir/qtwrkdev
fix missing entries and typo
This commit is contained in:
@@ -401,20 +401,23 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
system_tweak() {
|
system_tweak() {
|
||||||
|
|
||||||
number=$(grep -n "127.0.0.1" /etc/hosts | cut -d: -f 1)
|
number=$(grep -n "127.0.0.1" /etc/hosts | cut -d: -f 1)
|
||||||
my_hostname=$(hostname)
|
my_hostname=$(hostname)
|
||||||
|
|
||||||
for number2 in $number;
|
if [[ ! -z $number ]] ; then
|
||||||
do
|
for number2 in $number;
|
||||||
string=$(sed "${number2}q;d" /etc/hosts)
|
do
|
||||||
if [[ "$string" == *"my_hostname"* ]] ; then
|
string=$(sed "${number2}q;d" /etc/hosts)
|
||||||
:
|
if [[ "$string" == *"$my_hostname"* ]] ; then
|
||||||
else
|
:
|
||||||
new_string="$string $my_hostname"
|
else
|
||||||
sed -i "${number2}s/.*/${new_string}/" /etc/hosts
|
new_string="$string $my_hostname"
|
||||||
fi
|
sed -i "${number2}s/.*/${new_string}/" /etc/hosts
|
||||||
done
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "127.0.0.1 $my_hostname " >> /etc/hosts
|
||||||
|
fi
|
||||||
|
|
||||||
#this should address on "sudo: unable to resolve host ..." on Ubuntu , it's not issue but annoying.
|
#this should address on "sudo: unable to resolve host ..." on Ubuntu , it's not issue but annoying.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user