blob: d1b92a1443ee3b02916f0b5e60d79f76dfd26c6a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#!/bin/bash
set -o pipefail
_APPDIR=/usr/lib/@appname@
_RUNNAME="${_APPDIR}/@runname@"
if [ ! -f "${_APPDIR}/appdata.tar.gz" ];then
echo "not found"
else
if [ ! -d "${_APPDIR}/appdata/@runname@" ];then
mkdir -p "${_APPDIR}/appdata"
touch "${_APPDIR}/appdata/20220823.txt"
bsdtar -xf "${_APPDIR}/appdata.tar.gz" -C "${_APPDIR}"
elif [ ! -f "${_APPDIR}/appdata/20220823.txt" ];then
mkdir -p "${_APPDIR}/appdata"
touch "${_APPDIR}/appdata/20220823.txt"
bsdtar -xf "${_APPDIR}/appdata.tar.gz" -C "${_APPDIR}"
fi
export PATH="${_APPDIR}:${_APPDIR}/files:${PATH}"
export LD_LIBRARY_PATH="${_APPDIR}/lib/qt:${_APPDIR}/lib/yixin:${LD_LIBRARY_PATH}"
export QT_PLUGIN_PATH="${_APPDIR}/plugins:${QT_PLUGIN_PATH}"
export QML_IMPORT_PATH="${_APPDIR}/qml:${QML_IMPORT_PATH}"
export QML2_IMPORT_PATH="${_APPDIR}/qml:${QML2_IMPORT_PATH}"
if [ `id -u` -eq 0 ];then
echo "You are a super admin"
env QTWEBENGINE_DISABLE_SANDBOX=1 exec "${_APPDIR}/@runname@" "$@" || exit $?
else
echo "You are a common user"
cd "${_APPDIR}" || { echo "Failed to change directory to ${_APPDIR}"; exit 1; }
exec "${_RUNNAME}" "$@" || exit $?
fi
fi
|