Révision 30

bin/install.sh (revision 30)
1 1
#!/bin/bash
2 2

  
3
mkdir -p /opt/gZFS
3
dir_gzfs="/opt/gZFS"
4
dir_bin="/opt/gZFS/bin"
5
dir_snap="/opt/gZFS/snapshots"
6
dir_replica="/opt/gZFS/replicas"
4 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
5 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

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

  
10
done
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
bin/uninstall.sh (revision 30)
1
#!/bin/bash
2

  
3

  
4
#Del symbolic link
5
for f in $(ls /opt/gZFS/bin)
6
do
7
   rm /sbin/$f
8
done
9

  
10
if [[ -e "/etc/cron.d/gZFS-get-disk-zpool" ]]
11
then
12
  rm /etc/cron.d/gZFS-get-disk-zpool
13
fi
14

  
15
echo "Please, if you want really remove the gZFS tools then remove /opt/gZFS, the cron files for replication/snapshoting in /etc/cron.d"
0 16

  

Formats disponibles : Unified diff