Lines 39-44
Link Here
|
39 |
KERNEL_RE='^@@TYPE@@ \([-.0-9A-Za-z]\{1,\}\) .*$' |
39 |
KERNEL_RE='^@@TYPE@@ \([-.0-9A-Za-z]\{1,\}\) .*$' |
40 |
|
40 |
|
41 |
progname=${0##*/} |
41 |
progname=${0##*/} |
|
|
42 |
progverb=0 |
42 |
|
43 |
|
43 |
# |
44 |
# |
44 |
# Print an error message and exit. |
45 |
# Print an error message and exit. |
Lines 74-79
Link Here
|
74 |
# Print the version of the currently running kernel. |
75 |
# Print the version of the currently running kernel. |
75 |
# |
76 |
# |
76 |
running_version() { |
77 |
running_version() { |
|
|
78 |
[ $progverb -gt 0 ] && \ |
79 |
echo `sysctl -n kern.osrelease kern.osreldate` || \ |
77 |
sysctl -n kern.osrelease |
80 |
sysctl -n kern.osrelease |
78 |
} |
81 |
} |
79 |
|
82 |
|
Lines 81-86
Link Here
|
81 |
# Print the hardcoded userland version. |
84 |
# Print the hardcoded userland version. |
82 |
# |
85 |
# |
83 |
userland_version() { |
86 |
userland_version() { |
|
|
87 |
[ $progverb -gt 0 ] && \ |
88 |
echo $USERLAND_VERSION `uname -U` || \ |
84 |
echo $USERLAND_VERSION |
89 |
echo $USERLAND_VERSION |
85 |
} |
90 |
} |
86 |
|
91 |
|
Lines 88-94
Link Here
|
88 |
# Print a usage string and exit. |
93 |
# Print a usage string and exit. |
89 |
# |
94 |
# |
90 |
usage() { |
95 |
usage() { |
91 |
echo "usage: $progname [-kru]" >&2 |
96 |
echo "usage: $progname [-kruv]" >&2 |
92 |
exit 1 |
97 |
exit 1 |
93 |
} |
98 |
} |
94 |
|
99 |
|
Lines 97-103
Link Here
|
97 |
# |
102 |
# |
98 |
main() { |
103 |
main() { |
99 |
# parse command-line arguments |
104 |
# parse command-line arguments |
100 |
while getopts "kru" option ; do |
105 |
while getopts "kruv" option ; do |
101 |
case $option in |
106 |
case $option in |
102 |
k) |
107 |
k) |
103 |
opt_k=1 |
108 |
opt_k=1 |
Lines 108-113
Link Here
|
108 |
u) |
113 |
u) |
109 |
opt_u=1 |
114 |
opt_u=1 |
110 |
;; |
115 |
;; |
|
|
116 |
v) |
117 |
progverb=1 |
118 |
;; |
111 |
*) |
119 |
*) |
112 |
usage |
120 |
usage |
113 |
;; |
121 |
;; |