Skip to content

Commit

Permalink
[fix] : Fixed the judgment method of the live environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Hayao0819 committed May 25, 2021
1 parent 7163d1d commit d2c9f6d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
10 changes: 9 additions & 1 deletion alterlinux-desktop-file/alterlinux-desktop-file
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
12 changes: 9 additions & 3 deletions alterlinux-welcome-page/alterlinux-welcome-page
Original file line number Diff line number Diff line change
Expand Up @@ -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

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

0 comments on commit d2c9f6d

Please sign in to comment.