Skip to content

Commit d2c9f6d

Browse files
committed
[fix] : Fixed the judgment method of the live environment
1 parent 7163d1d commit d2c9f6d

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

alterlinux-desktop-file/alterlinux-desktop-file

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,16 @@ set_permission(){
135135
gio set "${1}" metadata::trusted true
136136
}
137137

138+
# ライブ環境から実行されているかチェックします
139+
check_livecd(){
140+
if [[ -d "/run/archiso" ]] || grep "^archisobasedir=" "/proc/cmdline" 2> /dev/null 1>&2; then
141+
return 0
142+
fi
143+
return 1
144+
}
145+
138146
# calamaresのアイコン
139-
if pacman -Qq alterlinux-calamares 1> /dev/null 2> /dev/null; then
147+
if check_livecd; then
140148
source_file="/usr/share/alterlinux/desktop-file/calamares.desktop"
141149
desktop_icon="${desktop_dir}/$(basename "${source_file}")"
142150
copy "${source_file}" "${desktop_dir}"

alterlinux-welcome-page/alterlinux-welcome-page

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,16 @@ while true; do
123123
esac
124124
done
125125

126-
if [[ "${checklive}" = true ]]; then
127-
if [[ -n $(pacman -Q alterlinux-calamares) ]]; then
128-
exit 0
126+
# ライブ環境から実行されているかチェックします
127+
check_livecd(){
128+
if [[ -d "/run/archiso" ]] || grep "^archisobasedir=" "/proc/cmdline" 2> /dev/null 1>&2; then
129+
return 0
129130
fi
131+
return 1
132+
}
133+
134+
if [[ "${checklive}" = true ]] && check_livecd; then
135+
exit 0
130136
fi
131137

132138
# ブラウザが指定されていないなら一覧から自動で検出する

0 commit comments

Comments
 (0)