fix: activate ne pkg issue

This commit is contained in:
2024-01-17 15:44:09 +08:00
parent 9e54ccd886
commit bafc4b4c85
3 changed files with 82 additions and 70 deletions

16
misc/actpkg.sh Normal file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
expect <<EOF
set timeout 180
if [[ ${1} == *.deb ]]; then
spawn dpkg -i --force-all ${1}
elif [[ ${1} == *.rpm ]]; then
spawn rpm -Uvh ${1}
else
exit 1
#"The file does not have a .deb or .rpm extension"
fi
expect {
"y/n" { send "n\n";exp_continue }
}
EOF

View File

@@ -1,9 +0,0 @@
#!/bin/bash
expect <<EOF
set timeout ${1}
spawn dpkg -i --force-all ${3}
expect {
"y/n" { send "${2}\n";exp_continue }
}
EOF