From cc28da29f032bc6cb4d245b1698c05fe8f94018c Mon Sep 17 00:00:00 2001 From: Hayao Date: Wed, 18 Dec 2019 19:05:40 +0000 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E8=88=AC=E3=83=A6=E3=83=BC=E3=82=B6?= =?UTF-8?q?=E3=83=BC=E5=90=8D=E3=81=AE=E5=85=A5=E5=8A=9B=E3=82=92=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E3=81=AA=E9=99=90=E3=82=8A=E3=82=B9=E3=82=AD=E3=83=83?= =?UTF-8?q?=E3=83=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- run.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/run.sh b/run.sh index 21b4718..d592f56 100755 --- a/run.sh +++ b/run.sh @@ -102,6 +102,8 @@ function check_func () { #-- Rootチェック --# if [[ ! $UID = 0 ]]; then + echo -n 'aur_user=' > /tmp/user + echo "$(whoami)" >> /tmp/user pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY $current_path > /dev/null exit fi @@ -148,6 +150,8 @@ if [[ $ID = "arch" || $ID = "arch32" ]]; then if [[ -f /tmp/user ]]; then source /tmp/user [[ -z $aur_user ]] && ask_user + elif [[ ! $SUDO_USER = root ]]; then + aur_user=$SUDO_USER else ask_user fi @@ -155,6 +159,9 @@ if [[ $ID = "arch" || $ID = "arch32" ]]; then error 600 100 "存在しているユーザを入力してください。" ask_user done + if [[ -f /tmp/user ]]; then + rm -f /tmp/user + fi echo -n 'aur_user=' > /tmp/user echo "$aur_user" >> /tmp/user fi