Statistiques
| Révision :

root / bin / install.sh @ 30

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

1
#!/bin/bash
2

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

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

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

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

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

    
29
for f in $(ls)
30
do 
31
cp $f $dir_bin/
32
ln -s $dir_bin/$f /sbin/
33
done
34

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