Separate user creation
This commit is contained in:
parent
7243a87191
commit
39c1deacc0
6
install
6
install
@ -23,7 +23,7 @@ mkconfig(){
|
||||
echo "logchat = $logchat" >> config.py
|
||||
}
|
||||
|
||||
addfiles(){
|
||||
mkuser(){
|
||||
# Create user account, distro mess awaits here...
|
||||
# Debian has both useradd and adduser
|
||||
if [ -e /sbin/useradd ]
|
||||
@ -37,7 +37,9 @@ addfiles(){
|
||||
adduser -S bot
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
addfiles(){
|
||||
# Install executable and config
|
||||
mkdir /etc/ubot
|
||||
install -o root -g bot -m640 config.py /etc/ubot/config.py
|
||||
@ -58,6 +60,8 @@ addfiles(){
|
||||
pip3 install -U telethon
|
||||
# Generate config if not built yet
|
||||
[ ! -f config.py ] && mkconfig
|
||||
# Create a new user
|
||||
mkuser
|
||||
# Install files if config is (now) present
|
||||
[ -f config.py ] && addfiles
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user