root / bin / install.sh @ 51
Historique | Voir | Annoter | Télécharger (1,06 ko)
1 |
#!/bin/bash |
---|---|
2 |
# $Id: install.sh 51 2013-10-10 11:20:37Z ltaulell $ |
3 |
# Copyright (C) 2013 Kevin Reverchon, Loïs Taulelle |
4 |
# This file/program is part of gZFS free software |
5 |
# See COPYING file for details |
6 |
# |
7 |
|
8 |
dir_gzfs="/opt/gZFS" |
9 |
dir_bin="/opt/gZFS/bin" |
10 |
dir_snap="/opt/gZFS/snapshots" |
11 |
dir_replica="/opt/gZFS/replicas" |
12 |
|
13 |
#Check ... |
14 |
if [[ ! -e "/sbin/zfs" ]] |
15 |
then |
16 |
echo "Please /sbin/zfs not exists, you can install ZFS and create a symbolic link" |
17 |
exit 1 |
18 |
fi |
19 |
|
20 |
if [[ ! -e "/sbin/zpool" ]] |
21 |
then |
22 |
echo "Please /sbin/zpool not exists, you can install ZFS and create a symbolic link" |
23 |
exit 1 |
24 |
fi |
25 |
|
26 |
if [[ ! -e "/usr/sbin/ietadm" ]] && [[ ! -e "/sbin/ietadm" ]] |
27 |
then |
28 |
echo "Please /usr/sbin/ietadm or /sbin/ietadm not exists, you can install ietd (or iscsitarget) and create a symbolic link" |
29 |
exit 1 |
30 |
fi |
31 |
|
32 |
mkdir -p $dir_gfs $dir_bin $dir_snap $dir_replica |
33 |
|
34 |
for f in $(ls) |
35 |
do |
36 |
myPath=$(/bin/pwd) |
37 |
if [[ $myPath != "/opt/gZFS/bin" ]] |
38 |
then |
39 |
cp $f $dir_bin/ |
40 |
fi |
41 |
ln -s $dir_bin/$f /sbin/ |
42 |
done |
43 |
|
44 |
#create cron.d/get-disk-zpool |
45 |
echo "5 * * * * root /sbin/get-disk-zpool > /opt/gZFS/infodisks.cache" >/etc/cron.d/gZFS-get-disk-zpool |
46 |
/etc/init.d/cron restart |