2023-08-01 21:53:27 +08:00

57 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
if [ -x "/opt/durapps/transhell/transhell.sh" ]
then
source /opt/durapps/transhell/transhell.sh
load_transhell
else
if [ -f "/usr/share/ablrun/transhell/ablrun_${LANG%.*}.transhell" ]
then
source "/usr/share/ablrun/transhell/ablrun_${LANG%.*}.transhell"
else
source /usr/share/ablrun/transhell/ablrun_en_US.transhell
fi
fi
if [ "$*" = "" ]
then
echo -e "${TRANSHELL_CONTENT_AUTHOR_INFO_AND_LIB_LICENSE}"
echo -e "${TRANSHELL_CONTENT_USAGE}"
echo -e "${TRANSHELL_CONTENT_ADDITIONAL_BASE_LIB_INFO}"
echo
echo -e "${TRANSHELL_CONTENT_SCRIPT_AUTO_DETECT}"
echo -e "${TRANSHELL_CONTENT_APPIMAGE_INFO}"
echo -e "${TRANSHELL_CONTENT_NORMAL_EXECUTABLE_INFO}"
exit
fi
if [ `whoami` = "root" ]
then
exec ablrun-normal "$@"
fi
if [ -e "$1" ]
then
ABL_FILENAME="$1"
else
ABL_FILENAME=`which $1`
if [ "$?" != "0" ]
then
echo -e "${TRANSHELL_CONTENT_FILE_NOT_EXISTS}"
exit 1
fi
fi
ABL_FILETYPE=`xdg-mime query filetype "$ABL_FILENAME"`
if [ "$ABL_FILETYPE" != "application/vnd.appimage" ]
then
if [ "$ABL_FILETYPE" != "application/x-iso9660-appimage" ]
then
exec ablrun-normal "$@"
fi
fi
exec ablrun-appimage "$@"