Skip to content

Commit

Permalink
fix IP output and code cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
BassT23 committed Jan 4, 2025
1 parent 35f79b4 commit eb25d61
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
3 changes: 2 additions & 1 deletion change.log
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
Changelog:
==========

**v4.2.7** (develop)
**v4.2.8** (develop)
- fix START/STOP/WAITING for stopped VMs
- fix compatibility with "old" ssh connection
- fix IP output by nodes
- add non root user update in VMs

**v4.2.5** (beta)
Expand Down
20 changes: 10 additions & 10 deletions ssh.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,25 @@ PermitRootLogin yes
`sudo service sshd restart`


### IN HOST:
### IN HOST who hosted the VM:
- Copy ssh key to VM:
`ssh-copy-id -i /root/.ssh/id_rsa.pub root@<VM-IP>`
or, if used user is not root:
`ssh-copy-id -i /root/.ssh/id_rsa.pub <user>@<VM-IP>`


### IN HOST where ultimate-updater start:
- create one file per VM in `/etc/ultimate-updater/VMs/<ID>` with content:

`IP="111.111.111.111"` # use the IP from the VM!
`USER="root"`
`SSH_VM_PORT="22`
`SSH_START_DELAY_TIME="45"`

(IP can be found in VM with command: `hostname -I`)

- Copy ssh key to VM:

You need to make this step on the Host, who hosted the VM. If pve2 host VMxyz, you need to make the copy from pve2, not from the pve, on which you run the script ;)

`ssh-copy-id -i /root/.ssh/id_rsa.pub root@<VM-IP>`
or, if used user is not root:
`ssh-copy-id -i /root/.ssh/id_rsa.pub user@<VM-IP>`


## If user is NOT root, you need to prepare the user, to run admin commands - like `apt`
## If user is NOT root, you need to prepare the user, to run admin commands - like `apt` - but user MUST be part of group `sudo`

Example for Ubuntu/Debian - with sudo (change in VM):

Expand Down
6 changes: 3 additions & 3 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# shellcheck disable=SC2317
# shellcheck disable=SC2320

VERSION="4.2.7"
VERSION="4.2.8"

# Variable / Function
LOCAL_FILES="/etc/ultimate-updater"
Expand Down Expand Up @@ -492,7 +492,7 @@ HOST_UPDATE_START () {
# Host Update
UPDATE_HOST () {
HOST=$1
START_HOST=$(hostname -I | cut -d ' ' -f1)
START_HOST=$(hostname -i | cut -d ' ' -f1)
if [[ "$HOST" != "$START_HOST" ]]; then
ssh -q -p "$SSH_PORT" "$HOST" mkdir -p $LOCAL_FILES/temp
scp "$0" "$HOST":$LOCAL_FILES/update
Expand Down Expand Up @@ -952,7 +952,7 @@ export TERM=xterm-256color
if ! [[ -d "/etc/ultimate-updater/temp" ]]; then mkdir /etc/ultimate-updater/temp; fi
READ_CONFIG
OUTPUT_TO_FILE
IP=$(hostname -I | cut -d ' ' -f1)
IP=$(hostname -i | cut -d ' ' -f1)
ARGUMENTS "$@"

# Run without commands (Automatic Mode)
Expand Down

0 comments on commit eb25d61

Please sign in to comment.