source: open-sysclone/trunk/fuentes/open-sysclone-server.install/net/OpenSysClone/opensysclone-system/hostnamechanger.sh @ 647

Last change on this file since 647 was 647, checked in by daduve, 4 years ago

Ading file

File size: 321 bytes
Line 
1#!/bin/bash
2
3
4mkdir  -p /mnt/test
5NAME_END="$(ifconfig  | grep inet | cut -d ":"  -f2 | head -1| cut -d " " -f1| cut -d "." -f4)"
6
7
8for f in $(ls -1 /dev/sda*); do 
9        echo "Working with $f"
10        mount $f /mnt/test
11        if [ ! -e /mnt/test/etc/hostname ] ; then
12                echo "client$NAME_END"  > /mnt/test/etc/hostname
13        fi
14done
15
16exit 0
Note: See TracBrowser for help on using the repository browser.