File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed
Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff 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} "
Original file line number Diff line number Diff line change @@ -123,10 +123,16 @@ while true; do
123123 esac
124124done
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
130136fi
131137
132138# ブラウザが指定されていないなら一覧から自動で検出する
You can’t perform that action at this time.
0 commit comments