-
Notifications
You must be signed in to change notification settings - Fork 0
/
90-tgt
executable file
·47 lines (38 loc) · 852 Bytes
/
90-tgt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
set -e
# Create tgt iSCSI targets for all specified drives.
# This is disabled by default.
#
# To configure and reenable, do:
#
# vi /etc/config/tgt
# /etc/init.d/tgt enable
#
/etc/init.d/tgt disable
uci import tgt <<EOF
config options 'tgt'
option iothreads '16'
option logging '1'
config target '1'
option name 'iqn.2018-04.org.example:target-host'
# list allow_name 'iqn.2018-04.org.example:client-host'
# list allow_address '192.168.200.2'
config account
list target '1'
option user 'testuser1'
option password 'pass0001'
config account
list target '1'
option user 'testuser2'
option password 'pass0002'
option outgoing '1'
config lun '1_1'
option device '/dev/vda'
option type 'disk'
option bstype 'aio'
config lun '1_2'
option device '/dev/vdb'
option type 'disk'
option bstype 'aio'
EOF
uci commit tgt