Add proper user creation to install script
This commit is contained in:
parent
fc92080d55
commit
bc2a2a39b4
29
install
29
install
@ -343,6 +343,7 @@ osUserCreate()
|
||||
{
|
||||
case $OS in
|
||||
FreeBSD)
|
||||
# pw useradd -d /mempool -g mempool -n mempool
|
||||
osSudo "${ROOT_USER}" pw useradd $*
|
||||
;;
|
||||
Debian)
|
||||
@ -351,6 +352,18 @@ osUserCreate()
|
||||
esac
|
||||
}
|
||||
|
||||
osGroupCreate()
|
||||
{
|
||||
case $OS in
|
||||
FreeBSD)
|
||||
osSudo "${ROOT_USER}" pw groupadd $*
|
||||
;;
|
||||
Debian)
|
||||
osSudo "${ROOT_USER}" groupadd $*
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
osCertbotDryRun()
|
||||
{
|
||||
if [ ! -z "${HOSTNAME}" ];then
|
||||
@ -699,18 +712,17 @@ set -x
|
||||
# Install all the OS packages #
|
||||
###############################
|
||||
|
||||
osPackageUpdate
|
||||
osPackageUpgrade
|
||||
osPackageInstallAll
|
||||
|
||||
exit 0
|
||||
#osPackageUpdate
|
||||
#osPackageUpgrade
|
||||
#osPackageInstallAll
|
||||
|
||||
##########################
|
||||
# Mempool top-level repo #
|
||||
##########################
|
||||
|
||||
echo "[*] Creating Mempool user with Tor access"
|
||||
osUserCreate -d "${MEMPOOL_HOME}" -g "${MEMPOOL_GROUP}" -G "${TOR_GROUP}" "${MEMPOOL_USER}"
|
||||
osGroupCreate "${MEMPOOL_GROUP}"
|
||||
osUserCreate -d "${MEMPOOL_HOME}" -g "${MEMPOOL_GROUP}" -n "${MEMPOOL_USER}"
|
||||
id "${MEMPOOL_USER}"
|
||||
echo "[*] Creating Mempool data folder"
|
||||
osSudo "${ROOT_USER}" mkdir -p "${MEMPOOL_HOME}"
|
||||
@ -719,6 +731,8 @@ echo "[*] Cloning Mempool repo from ${MEMPOOL_REPO_URL}"
|
||||
osSudo "${MEMPOOL_USER}" git config --global advice.detachedHead false
|
||||
osSudo "${MEMPOOL_USER}" git clone --branch "${MEMPOOL_REPO_BRANCH}" "${MEMPOOL_REPO_URL}" "${MEMPOOL_HOME}/${MEMPOOL_REPO_NAME}"
|
||||
|
||||
exit 0
|
||||
|
||||
####################
|
||||
# Tor installation #
|
||||
####################
|
||||
@ -738,6 +752,9 @@ if [ "${TOR_INSTALL}" = ON ];then
|
||||
osSudo "${ROOT_USER}" /bin/sh -c "echo HiddenServiceVersion 3 >> ${TOR_CONFIGURATION}"
|
||||
fi
|
||||
|
||||
# TODO: ADD mempool, bitcoin, bisq to tor group
|
||||
# TODO: detect what the tor group is on this OS somehow
|
||||
|
||||
# start tor now so it can bootstrap in time for bitcoin starting a few mins later
|
||||
echo "[*] Starting Tor service"
|
||||
osSudo "${ROOT_USER}" service tor start
|
||||
|
Loading…
x
Reference in New Issue
Block a user