Skip to content

Instantly share code, notes, and snippets.

@luisadha
Last active October 23, 2022 08:24
Show Gist options
  • Save luisadha/d9bf085377e29bb55ff335d0c54ecf8b to your computer and use it in GitHub Desktop.
Save luisadha/d9bf085377e29bb55ff335d0c54ecf8b to your computer and use it in GitHub Desktop.
For modify system hostname.
#!/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