chgt scripts debian11
This commit is contained in:
14
scripts/debian11/chname
Normal file
14
scripts/debian11/chname
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
if [[ $# != 1 ]] ; then
|
||||
echo "$0 - renomme une VM"
|
||||
echo "usage : $0 <nouveaunom> "
|
||||
exit 1
|
||||
fi
|
||||
if [[ $1 == "version" ]] ; then
|
||||
echo 'chname v1.1 pour debian 11'
|
||||
exit 0
|
||||
fi
|
||||
oldname=$(hostname)
|
||||
sed -i "s/${oldname}/$1/g" /etc/host{s,name}
|
||||
echo 'redemarrer pour finaliser le changement du nom'
|
||||
exit 0
|
Reference in New Issue
Block a user