Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ppabc committed Sep 2, 2016
1 parent 2a33186 commit 5b55840
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 31 deletions.
2 changes: 1 addition & 1 deletion disk/auto_fdisk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fi
check_disk()
{
>$LOCKfile
device_list=$(fdisk -l|grep "Disk"|grep "/dev"|awk '{print $2}'|awk -F: '{print $1}'|grep "sd")
device_list=$(fdisk -l|grep "dev"|grep "sd"|awk -F [:] '{print $1}' |awk '{print $2}' |awk -F: '{print $1}' |head -n 1)
fdisk -l|grep "sda" |grep "dev" |grep Linux |grep "sd"|awk '{print $1}' >$tmp1
}

Expand Down
62 changes: 32 additions & 30 deletions linux-init-script/init_centos7.sh
Original file line number Diff line number Diff line change
Expand Up @@ -292,44 +292,46 @@ chmod +x /etc/rc.d/rc.local

# 路由设置
route_config(){
localip=`ip a|grep "inet "|awk -F" " '{print $2}'|awk -F"/" '{print $1}'|egrep "^192" |head -n 1 |awk -F '[.]' '{print $3}'`
if [ "$localip" == "10" ];then
echo "/usr/sbin/route add -net 192.168.20.0 netmask 255.255.255.0 gw 192.168.1.1">/opt/sh/route.sh
echo "route -n">>/opt/sh/route.sh
fi
if [ "$localip" == "20" ];then
echo "/usr/sbin/route add -net 192.168.10.0 netmask 255.255.255.0 gw 192.168.2.1">/opt/sh/route.sh
echo "route -n">>/opt/sh/route.sh
fi
chmod +x /opt/sh/route.sh
/opt/sh/route.sh
echo "/opt/sh/route.sh" >>/etc/rc.local
#localip=`ip a|grep "inet "|awk -F" " '{print $2}'|awk -F"/" '{print $1}'|egrep "^192" |head -n 1 |awk -F '[.]' '{print $3}'`
#if [ "$localip" == "10" ];then
# echo "/usr/sbin/route add -net 192.168.20.0 netmask 255.255.255.0 gw 192.168.1.1">/opt/sh/route.sh
# echo "route -n">>/opt/sh/route.sh
#fi
#if [ "$localip" == "20" ];then
# echo "/usr/sbin/route add -net 192.168.10.0 netmask 255.255.255.0 gw 192.168.2.1">/opt/sh/route.sh
# echo "route -n">>/opt/sh/route.sh
#fi
#chmod +x /opt/sh/route.sh
#/opt/sh/route.sh
#echo "/opt/sh/route.sh" >>/etc/rc.local
echo ok
}

# VIM设置
vim_config(){
cat > /root/.vimrc << EOF
set history=1000
autocmd InsertLeave * se cul
autocmd InsertLeave * se nocul
set nu
set bs=2
syntax on
set laststatus=2
set tabstop=4
set go=
set ruler
set showcmd
set cmdheight=1
hi CursorLine cterm=NONE ctermbg=blue ctermfg=white guibg=blue guifg=white
set hls
set cursorline
set ignorecase
set hlsearch
set incsearch
set helplang=cn
EOF

#autocmd InsertLeave * se cul
#autocmd InsertLeave * se nocul
#set nu
#set bs=2
#syntax on
#set laststatus=2
#set tabstop=4
#set go=
#set ruler
#set showcmd
#set cmdheight=1
#hi CursorLine cterm=NONE ctermbg=blue ctermfg=white guibg=blue guifg=white
#set hls
#set cursorline
#set ignorecase
#set hlsearch
#set incsearch
#set helplang=cn
}


Expand Down

0 comments on commit 5b55840

Please sign in to comment.