Fix #16. Introduce check_sudo_dependency.
This commit is contained in:
parent
19d3b5637c
commit
79a63f5816
13
flash-it.sh
13
flash-it.sh
|
@ -88,6 +88,13 @@ function check_dependency {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Add sbin to the PATH to check for commands available to sudo
|
||||||
|
function check_sudo_dependency {
|
||||||
|
dependency=$1
|
||||||
|
local PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin
|
||||||
|
check_dependency $dependency
|
||||||
|
}
|
||||||
|
|
||||||
# Determine if wget supports the --show-progress option (introduced in
|
# Determine if wget supports the --show-progress option (introduced in
|
||||||
# 1.16). If so, make use of that instead of spewing out redirects and
|
# 1.16). If so, make use of that instead of spewing out redirects and
|
||||||
# loads of info into the terminal.
|
# loads of info into the terminal.
|
||||||
|
@ -105,14 +112,14 @@ function wget_cmd {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
check_dependency "parted"
|
|
||||||
check_dependency "sudo"
|
check_dependency "sudo"
|
||||||
check_dependency "wget"
|
check_dependency "wget"
|
||||||
check_dependency "tar"
|
check_dependency "tar"
|
||||||
check_dependency "unzip"
|
check_dependency "unzip"
|
||||||
check_dependency "lsblk"
|
check_dependency "lsblk"
|
||||||
check_dependency "mkfs.ext4"
|
check_sudo_dependency "parted"
|
||||||
check_dependency "losetup"
|
check_sudo_dependency "mkfs.ext4"
|
||||||
|
check_sudo_dependency "losetup"
|
||||||
|
|
||||||
# If use custom dir check it
|
# If use custom dir check it
|
||||||
if [ "$CUSTOM" != "" ]; then
|
if [ "$CUSTOM" != "" ]; then
|
||||||
|
|
Loading…
Reference in New Issue