FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


preparation:target:fasthandle-init.htmlt



Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
preparation:target:fasthandle-init.htmlt [2017/12/20 01:27]
kurihara
preparation:target:fasthandle-init.htmlt [2018/01/30 01:54]
kurihara ↷ Page moved and renamed from preparation:fasthandle-init.html to preparation:target:fasthandle-init.htmlt
Line 32: Line 32:
 # #
 # How to use # How to use
 +#     ./fh-init.sh
 #     ./fh-init.sh  test-server-01 #     ./fh-init.sh  test-server-01
-# 
 #================================================= #=================================================
  
Line 61: Line 61:
 </sxh> </sxh>
  
 +==== RHEL6/CentOS6 ====
 +<sxh bash toolbar:false gutter:false>
 +#!/bin/bash
 +#=================================================
 +# fh-init.sh   HOSTNAME
 +#
 +# How to use
 +#     ./fh-init.sh
 +#     ./fh-init.sh  test-server-01
 +#=================================================
 +
 +# Hostname Settings
 +if [ ! -z $1 ] ; then
 +    HOSTNAME=$1
 +    hostname $HOSTNAME
 +    
 +    #/etc/sysconfig/network
 +    cp -p /etc/sysconfig/network /etc/sysconfig/network.`date '+%Y%m%d'
 +    grep -v HOSTNAME /etc/sysconfig/network > /tmp/network
 +    cat /tmp/network > /etc/sysconfig/network
 +    echo HOSTNAME=$H >> /etc/sysconfig/network
 +fi
 +
 +
 +# Create fasthandle user
 +useradd fasthandle
 +echo 'fasthandle:fastpass' | chpasswd
 +
 +
 +# sudoers
 +cp -p  /etc/sudoers  /etc/sudoers.`date -d '1day ago' +%Y%m%d`
 +
 +cat << @ >> /etc/sudoers
 +
 +
 +# FastHandle
 +fasthandle    ALL=(ALL)   NOPASSWD:ALL
 +
 +@
 +</sxh>
  
  


preparation/target/fasthandle-init.htmlt.txt · Last modified: 2019/02/13 22:07 by kurihara