mirror of
https://gitee.com/spark-store-project/additional-base-lib
synced 2025-08-21 04:12:21 +08:00
51 lines
1.5 KiB
Bash
Executable File
51 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ "$*" = "" ]
|
|
then
|
|
echo "usage: $0 [command [arguments ...]]"
|
|
echo " The script is part of additional-base-lib. The package provides a"
|
|
echo " simple way to solve the compatible problem between application and"
|
|
echo " glibc, powered by bubblewrap."
|
|
echo
|
|
echo " All the library files, which packed with additional-base-lib,"
|
|
echo " are taken from one GNU/Linux distribution. You may found information"
|
|
echo " in package control files. The scripts theirselves were created by"
|
|
echo " CongTianKong <https://gitee.com/CongTianKong>. There's no lisence"
|
|
echo " nor copyright restriction with The script. Feel free to deal with."
|
|
echo
|
|
echo " This script auto-detects normal executable and appimage, and then"
|
|
echo " uses specified script to run either. If you experienced issues,"
|
|
echo " you may want to use them directly."
|
|
echo " for appimage, you need ablrun-appimage."
|
|
echo " for normal executable, you need ablrun-normal."
|
|
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 "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 "$@"
|