Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

Commit

Permalink
一般ユーザー名の入力を可能な限りスキップ
Browse files Browse the repository at this point in the history
  • Loading branch information
Hayao0819 committed Dec 18, 2019
1 parent ff3c0c6 commit cc28da2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -148,13 +150,18 @@ 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
while [ $(user_check $aur_user) = 1 ]; do
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
Expand Down

0 comments on commit cc28da2

Please sign in to comment.