echo "Pi-Apps is not supported on the outdated $(cat /etc/os-release | grep VERSION_CODENAME | tr -d '"' | awk -F= '{print $2}') operating system. Expect many apps to fail. Consider upgrading your operating system."
return 1
elif [[ "$(uname -m)" == armv6* ]];then
echo "Pi-Apps has not been tested on armv6 Raspberry Pi boards. Expect many apps to fail."
return 1
fi
return 0
}
format_log_file() { #remove ANSI escape sequences from a given file, and add OS information to beginning of file
[ -z "$1" ] && error "format_log_file: no filename given!"
[ ! -f "$1" ] && error "format_log_file: given filename ($1) does not exist or is not a file!"
@ -397,11 +411,7 @@ format_log_file() { #remove ANSI escape sequences from a given file, and add OS
get_device_info() { #returns information about current install and hardware
error "Pi-Apps is not not supported on x86 processors."
fi
#check for internet connection
if ! ping -c 1 github.com &>/dev/null ;then
error "No internet connection!\ngithub.com failed to respond.\nErrors: $(ping -c 1 github.com 2>&1)"
if ! wget --spider github.com &>/dev/null ;then
error "No internet connection!\ngithub.com failed to respond.\nErrors: $(wget --spider github.com 2>&1)"
fi
dirhash() {
@ -42,41 +38,20 @@ dirhash() {
echo "$hash"
}
if [ "$1" == 'multi-install' ];then
failed_apps=''
IFS=$'\n'
for app in $2
do
"${DIRECTORY}/manage" install "$app"
if [ $? != 0 ];then
#this app failed to install - add it to the list of failed apps
failed_apps="$failed_apps
$app"
fi
done
app_results="${app_results:1}" #remove first blank newline
for app in $(echo "$failed_apps" | list_intersect "$(list_apps online)") ;do
logfile="$(ls -dt "${DIRECTORY}/logs"/* | grep '\-'"${app}"'\.log' -m 1)" #sort logfiles by modification date, get the most recent one for the current app
send_error_report_gui "$logfile" "<b>$app</b> failed to install."
fi
done
if [ ! -z "$failed_apps" ];then
exit 1
if [ "$1" == 'multi-uninstall' ];then
action=uninstall
elif [ "$1" == 'multi-install' ];then
action=install
fi
elif [ "$1" == 'multi-uninstall' ];then
failed_apps=''
IFS=$'\n'
for app in $2
do
"${DIRECTORY}/manage" uninstall "$app"
"${DIRECTORY}/manage" $action "$app"
if [ $? != 0 ];then
#this app failed to install - add it to the list of failed apps
failed_apps="$failed_apps
@ -85,14 +60,16 @@ $app"
done
app_results="${app_results:1}" #remove first blank newline
for app in $(echo "$failed_apps" | list_intersect "$(list_apps online)") ;do
logfile="$(ls -dt "${DIRECTORY}/logs"/* | grep '\-'"${app}"'\.log' -m 1)" #sort logfiles by modification date, get the most recent one for the current app
if [ "$supported" == yes ];then #if hardware and OS is supported
for app in $(echo "$failed_apps" | list_intersect "$(list_apps online)") ;do
logfile="$(ls -dt "${DIRECTORY}/logs"/* | grep '\-'"${app}"'\.log' -m 1)" #sort logfiles by modification date, get the most recent one for the current app
#if logfile detected, exists, and is not empty, ask permission to send error report