main: modify local_install.sh

This commit is contained in:
Gary 2024-02-23 09:12:55 -08:00
parent d625c7500c
commit fcb310b15b

View File

@ -186,13 +186,13 @@ if [ -s /etc/docker/daemon.json.original-"$DATE" ]; then
DIFF=$(diff <(jq --sort-keys . /etc/docker/daemon.json) <(jq --sort-keys . /etc/docker/daemon.json.original-"$DATE"))
if [ "$DIFF" != "" ]; then
echo "Docker configuration updated, restart docker daemon..."
systemctl restart docker
sudo systemctl restart docker
else
echo "Docker configuration is up to date."
fi
else
echo "Docker configuration updated, restart docker daemon..."
systemctl restart docker
sudo systemctl restart docker
fi
echo -e "-------------"
@ -219,8 +219,8 @@ cp -r /home/lasthour/lasthourcloud/app/Livewire /data/coolify/
cp /home/lasthour/lasthourcloud/.coolify-logo /data/coolify/.coolify-logo
cp /home/lasthour/lasthourcloud/tailwind.config.js /data/coolify/tailwind/
chown -R 9999:root /data/coolify
chmod -R 700 /data/coolify
sudo chown -R 9999:root /data/coolify
sudo chmod -R 700 /data/coolify
# Copy .env.example if .env does not exist
if [ ! -f /data/coolify/source/.env ]; then
@ -248,18 +248,18 @@ fi
# Generate an ssh key (ed25519) at /data/coolify/ssh/keys/id.root@host.docker.internal
if [ ! -f /data/coolify/ssh/keys/id.root@host.docker.internal ]; then
ssh-keygen -t ed25519 -a 100 -f /data/coolify/ssh/keys/id.root@host.docker.internal -q -N "" -C root@coolify
chown 9999 /data/coolify/ssh/keys/id.root@host.docker.internal
sudo chown 9999 /data/coolify/ssh/keys/id.root@host.docker.internal
fi
addSshKey() {
cat /data/coolify/ssh/keys/id.root@host.docker.internal.pub >>~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
sudo cat /data/coolify/ssh/keys/id.root@host.docker.internal.pub >>~/.ssh/authorized_keys
sudo chmod 600 ~/.ssh/authorized_keys
}
if [ ! -f ~/.ssh/authorized_keys ]; then
mkdir -p ~/.ssh
chmod 700 ~/.ssh
touch ~/.ssh/authorized_keys
sudo mkdir -p ~/.ssh
sudo chmod 700 ~/.ssh
sudo touch ~/.ssh/authorized_keys
addSshKey
fi