Last active
October 23, 2022 08:24
-
-
Save luisadha/d9bf085377e29bb55ff335d0c54ecf8b to your computer and use it in GitHub Desktop.
For modify system hostname.
This file contains 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
#!/system/bin/sh | |
# Author: luisadha | |
# Script to change system hostname, reboot to restore it. | |
# **Su binaries needed & busybox too** | |
local file="$0: $1: No such file or directory" | |
local usage="usage:\thostnamchanger FILE... " | |
[ $# -lt 1 ] && echo $usage && return 1 | |
[ ! -f $1 ] && echo $file && return 1 | |
local arg="$*"; | |
su -c busybox hostname -F "$arg" | |
echo '**Hostname changed, load new shell sessions!**' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment