You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
93 lines
1.6 KiB
93 lines
1.6 KiB
1 year ago
|
exitmsg()
|
||
|
{
|
||
|
echo "$1"
|
||
|
exit $2
|
||
|
}
|
||
|
|
||
|
cdcheck()
|
||
|
{
|
||
|
case $1 in
|
||
|
0)
|
||
|
echo "cd $2"
|
||
|
;;
|
||
|
1)
|
||
|
exitmsg "Error: cd $2, exiting..." 1
|
||
|
;;
|
||
|
*)
|
||
|
exitmsg "Error: cd $2 unknown error " $?
|
||
|
;;
|
||
|
esac
|
||
|
}
|
||
|
|
||
|
wgetcheck()
|
||
|
{
|
||
|
case $1 in
|
||
|
0)
|
||
|
echo "osinfo-detect-test.sh log: wget $2 No problems occurred."
|
||
|
;;
|
||
|
1)
|
||
|
exitmsg "Error: wget $2 Generic error code, exiting..." 1
|
||
|
;;
|
||
|
2)
|
||
|
exitmsg "Error: wget $2 Parse error---for instance, when parsing command-line options, the .wgetrc or .netrc..., exiting..." 2
|
||
|
;;
|
||
|
3)
|
||
|
exitmsg "Error: wget $2 File I/O error, exiting..." 3
|
||
|
;;
|
||
|
4)
|
||
|
exitmsg "Error: wget $2 Network failure, exiting..." 4
|
||
|
;;
|
||
|
5)
|
||
|
exitmsg "Error: wget $2 SSL verification failure, exiting..." 5
|
||
|
;;
|
||
|
6)
|
||
|
exitmsg "Error: wget $2 Username/password authentication failure, exiting..." 6
|
||
|
;;
|
||
|
7)
|
||
|
exitmsg "Error: wget $2 Protocol errors, exiting..." 7
|
||
|
;;
|
||
|
8)
|
||
|
exitmsg "Error: wget $2 Server issued an error response, exiting..." 8
|
||
|
;;
|
||
|
*)
|
||
|
exitmsg "Error: wget unknown error " $?
|
||
|
;;
|
||
|
esac
|
||
|
}
|
||
|
|
||
|
osinfodetectcheck()
|
||
|
{
|
||
|
case $1 in
|
||
|
0)
|
||
|
echo "Detecting completed successfully."
|
||
|
;;
|
||
|
1)
|
||
|
exitmsg "Error: Detecting comleted with error, exiting..." 1
|
||
|
;;
|
||
|
253)
|
||
|
exitmsg "Error: Internal test error (Error parsing media: Failed to open file:) when osinfo detecting, exiting..." 2
|
||
|
;;
|
||
|
*)
|
||
|
exitmsg "Error: osinfo-detect unknown error " $?
|
||
|
;;
|
||
|
esac
|
||
|
}
|
||
|
|
||
|
diffcheck()
|
||
|
{
|
||
|
case $1 in
|
||
|
0)
|
||
|
echo "Test completed successfully."
|
||
|
;;
|
||
|
1)
|
||
|
exitmsg "Error: Test unsuccessful, exiting..." 1
|
||
|
;;
|
||
|
2)
|
||
|
exitmsg "Error: There was a trouble when result check after osinfo detecting, exiting..." 2
|
||
|
;;
|
||
|
*)
|
||
|
exitmsg "Error: cd $2 unknown error " $?
|
||
|
;;
|
||
|
esac
|
||
|
}
|