OSDN Git Service

[fix] : Fixed the judgment method of the live environment v1.8.1
authorhayao <hayao@fascode.net>
Tue, 25 May 2021 11:26:52 +0000 (20:26 +0900)
committerhayao <hayao@fascode.net>
Tue, 25 May 2021 11:26:52 +0000 (20:26 +0900)
alterlinux-desktop-file/alterlinux-desktop-file
alterlinux-welcome-page/alterlinux-welcome-page

index 26d59fb..cac7b68 100755 (executable)
@@ -135,8 +135,16 @@ set_permission(){
     gio set "${1}" metadata::trusted true
 }
 
+# ライブ環境から実行されているかチェックします
+check_livecd(){
+    if [[ -d "/run/archiso" ]] || grep "^archisobasedir=" "/proc/cmdline" 2> /dev/null 1>&2; then
+        return 0
+    fi
+    return 1
+}
+
 # calamaresのアイコン
-if pacman -Qq alterlinux-calamares 1> /dev/null 2> /dev/null; then
+if check_livecd; then
     source_file="/usr/share/alterlinux/desktop-file/calamares.desktop"
     desktop_icon="${desktop_dir}/$(basename "${source_file}")"
     copy "${source_file}" "${desktop_dir}"
index 3471691..a929ea1 100755 (executable)
@@ -123,10 +123,16 @@ while true; do
     esac
 done
 
-if [[ "${checklive}" = true ]]; then
-    if [[ -n $(pacman -Q alterlinux-calamares) ]]; then
-        exit 0
+# ライブ環境から実行されているかチェックします
+check_livecd(){
+    if [[ -d "/run/archiso" ]] || grep "^archisobasedir=" "/proc/cmdline" 2> /dev/null 1>&2; then
+        return 0
     fi
+    return 1
+}
+
+if [[ "${checklive}" = true ]] && check_livecd; then
+    exit 0
 fi
 
 # ブラウザが指定されていないなら一覧から自動で検出する