fix: activate pkg issue
This commit is contained in:
@@ -2,14 +2,19 @@
|
|||||||
|
|
||||||
expect <<EOF
|
expect <<EOF
|
||||||
set timeout 180
|
set timeout 180
|
||||||
if [[ ${1} == *.deb ]]; then
|
file_extension=$(basename "${1}" | awk -F . '{print $NF}')
|
||||||
|
case $file_extension in
|
||||||
|
deb)
|
||||||
spawn dpkg -i --force-all ${1}
|
spawn dpkg -i --force-all ${1}
|
||||||
elif [[ ${1} == *.rpm ]]; then
|
;;
|
||||||
|
rpm)
|
||||||
spawn rpm -Uvh ${1}
|
spawn rpm -Uvh ${1}
|
||||||
else
|
;;
|
||||||
|
*)
|
||||||
exit 1
|
exit 1
|
||||||
#"The file does not have a .deb or .rpm extension"
|
#"The file does not have a .deb or .rpm extension"
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
expect {
|
expect {
|
||||||
"y/n" { send "n\n";exp_continue }
|
"y/n" { send "n\n";exp_continue }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user