#1139 change default user and directories

pull/3/head
Nicolas Arenas 2024-11-13 13:02:11 +01:00
parent 3891130480
commit bac07800b4
1 changed files with 9 additions and 9 deletions

View File

@ -6,8 +6,8 @@ GIT_BRANCH=$1
GIT_REPO=https://ognproject.evlt.uma.es/gitea/opengnsys/ogrepository.git
GIT_SSL_NO_VERIFY=true
REPO_IP=${REPO_IP:-"127.0.0.1"}
SMBUSER=${SMBUSER:-"ogrepository"}
SMBPASS=${SMBPASS:-"ogrepository"}
OGUSER=${OGUSER:-"opengnsys"}
OGPASS=${OGPASS:-"og"}
INSTALL_DIR=/opt/opengnsys/ogrepository
DOWNLOAD_DIR=/tmp/ogrepository
DEBIAN_FRONTEND=noninteractive
@ -37,13 +37,13 @@ install_updcast () {
}
add_user_ogrepository() {
if ! id "ogrepository" &>/dev/null; then
if ! id "$OGUSER" &>/dev/null; then
echo "User ogrepository does not exist, creating it"
useradd -r -s /bin/bash ogrepository
useradd -r -s /bin/bash $OGUSER
fi
if [ ! -f /etc/sudoers.d/ogrepository ]; then
echo "User ogrepository does not have sudo permissions, adding it"
echo 'ogrepository ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/ogrepository
if [ ! -f /etc/sudoers.d/$OGUSER ]; then
echo "User $OGUSER does not have sudo permissions, adding it"
echo 'ogrepository ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/"$OGUSER"
fi
}
@ -85,10 +85,10 @@ install_files() {
configure_samba() {
echo "include = /etc/samba/smb.conf.ogrepository" >> /etc/samba/smb.conf
cp $DOWNLOAD_DIR/installer/files/ogrepo-smb.conf /etc/samba/smb.conf.ogrepository
sed -i "s/%%OGREPOSITORY_USER%%/$SMBUSER/g" /etc/samba/smb.conf.ogrepository
sed -i "s/%%OGREPOSITORY_USER%%/$OGUSER/g" /etc/samba/smb.conf.ogrepository
systemctl restart smbd
# Create default user ogrepository
(echo $SMBPASS; echo $SMBPASS) | smbpasswd -s -a $SMBUSER
(echo $OGPASS; echo $OGPASS) | smbpasswd -s -a $OGUSER
}