Last active
September 17, 2021 00:15
-
-
Save kasiimh1/7d6d72e9def6ea6b1103c90ae89007e8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Created by Kasiimh1 - https://gist.github.com/kasiimh1/7d6d72e9def6ea6b1103c90ae89007e8" | |
#Fix 'unable to resolve host VPSHOSTNAME: Name or service not known' on Liteserver! | |
hostname="$(cat /proc/sys/kernel/hostname)" | |
echo -n "Do you have the 'hostname: Name or service not known' when signing in via SSH? (y/n)? " | |
read answer | |
if [ "$answer" != "${answer#[Yy]}" ]; then | |
echo "Editing hostfile to add $hostname entry" | |
echo "127.0.0.1 " $hostname >> /etc/hosts | |
fi | |
echo "Exiting!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment