-
Notifications
You must be signed in to change notification settings - Fork 44
/
iohyve
executable file
·98 lines (88 loc) · 1.84 KB
/
iohyve
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/bin/sh
# iohyve v0.7.9 2017/06/26 "I Believe in You, You Can Do the Thing Edition"
# Set proper path thanks to iocage
PATH=${PATH}:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin
# Check if libs are available (stolen from iocage)
if [ -e "./lib/ioh-cmd" ] ; then
LIB="./lib"
elif [ -e "/usr/local/lib/iohyve" ] ; then
LIB="/usr/local/lib/iohyve"
else
echo "ERROR: missing libraries"
exit 1
fi
. /etc/rc.subr
. "${LIB}/ioh-cmd"
. "${LIB}/ioh-setup"
. "${LIB}/ioh-zfs"
. "${LIB}/ioh-console"
. "${LIB}/ioh-iso"
. "${LIB}/ioh-firmware"
. "${LIB}/ioh-guest"
. "${LIB}/ioh-disk"
. "${LIB}/ioh-tap"
# Show version
__version() {
echo "iohyve v0.7.9 2017/06/26 I Believe in You, You Can Do the Thing Edition"
}
# Print help page
__help() {
cat << 'EOT'
iohyve version
setup <pool=poolname> [kmod=0|1] [net=iface]
list [-l]
info [-vsdl]
isolist
fwlist
fetchiso <URL>
cpiso <path>
renameiso <ISO> <newname>
rmiso <ISO>
fetchfw <URL>
cpfw <path>
renamefw <firmware> <newname>
rmfw <firmware>
create <name> <size> [pool]
install <name> <ISO>
load <name> <path/to/bootdisk>
boot <name> [runmode] [pcidevices]
start <name> [-s | -a]
stop <name>
forcekill <name>
scram
destroy <name>
rename <name> <newname>
delete [-f] <name>
set <name> <property=value> ...
get <name> <prop>
rmprop [-f] <name> <property>
getall <name>
add <name> <size>
remove [-f] <name> <diskN>
resize <name> <diskN> <size>
disks <name>
snap <name>@<snap>
roll <name>@<snap>
rmsnap [-f] <name>@<snap>
clone [-r] <name> <clonename>
export <name>
snaplist
taplist
tapadd <name> [iface]
tapdel <name> <tap>
activetaps
conlist
console <name>
conreset
help
EOT
}
if [ -z "$1" ] ; then
__help
exit 0
fi
if __root_req_cmd "$1" && [ "$(id -u)" != "0" ]; then
echo "The $1 command needs root credentials!"
exit 1
fi
__parse_cmd "$@"