Statistiques
| Révision :

root / bin / install.sh @ 39

Historique | Voir | Annoter | Télécharger (953 octet)

1
#!/bin/bash
2
# $Id: install.sh 39 2013-10-08 12:46:21Z ltaulell $
3

    
4
dir_gzfs="/opt/gZFS"
5
dir_bin="/opt/gZFS/bin"
6
dir_snap="/opt/gZFS/snapshots"
7
dir_replica="/opt/gZFS/replicas"
8

    
9
#Check ...
10
if [[ ! -e "/sbin/zfs" ]]
11
then
12
   echo "Please /sbin/zfs not exists, you can install ZFS and create a symbolic link" 
13
   exit 1
14
fi
15

    
16
if [[ ! -e "/sbin/zpool" ]]
17
then
18
  echo "Please /sbin/zpool not exists, you can install ZFS and create a symbolic link"
19
  exit 1
20
fi
21

    
22
if [[ ! -e "/usr/sbin/ietadm" ]] && [[ ! -e "/sbin/ietadm" ]]
23
then
24
  echo "Please /usr/sbin/ietadm or /sbin/ietadm not exists, you can install ietd (or iscsitarget) and create a symbolic link"
25
  exit 1
26
fi
27

    
28
mkdir -p $dir_gfs $dir_bin $dir_snap $dir_replica
29

    
30
for f in $(ls)
31
do 
32
myPath=$(/bin/pwd)
33
if [[ $myPath != "/opt/gZFS/bin" ]]
34
then
35
  cp $f $dir_bin/
36
fi
37
ln -s $dir_bin/$f /sbin/
38
done
39

    
40
#create cron.d/get-disk-zpool
41
echo "5 * * * * root /sbin/get-disk-zpool > /opt/gZFS/infodisks.cache" >/etc/cron.d/gZFS-get-disk-zpool
42
/etc/init.d/cron restart