Been testing beta on a couple of servers/vms and got tired of looking up the uid/lid numbers for the servers, so threw together a script to do it all for me. I noticed that what I needed was always in the setup.txt file on the servers/vms. Added in a little extra checking top stop the script if things are missing, and just do the update for me. It saves the previous update file in case it's needed to roll back.
Just thought I would share.
It's an adaption of this page: https://help.directadmin.com/item.php?id=408
As usual USE AT YOUR OWN RISK. Always make backups. If you don't understand how this works don't use it.
Hopefully this is an appropriate area to post this.
Just thought I would share.
It's an adaption of this page: https://help.directadmin.com/item.php?id=408
As usual USE AT YOUR OWN RISK. Always make backups. If you don't understand how this works don't use it.
Bash:
#!/bin/bash
# This script will use the setup file to determine User ID number and License ID number to fetch and update Direct Admin
# Caution: Use at your own risk. Only tested on Debian 9 & 10.
release='beta'
setuptxt='/usr/local/directadmin/scripts/setup.txt'
[[ -f $setuptxt ]] || { printf '%s does not exist!\n' "$setuptxt" ; exit 1; }
uid=$( grep --color=never -Po "^uid=\K.*" "$setuptxt" || true)
lid=$( grep --color=never -Po "^lid=\K.*" "$setuptxt" || true)
[[ -z "$uid" ]] && { echo "User ID Number not found in setup file" ; exit 1; }
[[ -z "$lid" ]] && { echo "License ID Number not found in setup file" ; exit 1; }
cd /usr/local/directadmin
mv new.tar.gz new.tar.gz-old
wget --no-check-certificate -O new.tar.gz "https://www.directadmin.com/cgi-bin/daupdate?redirect=no&uid=$uid&lid=$lid&channel=$release"
tar xvzf new.tar.gz
./directadmin p
scripts/update.sh
killall -9 directadmin
./directadmin d
Hopefully this is an appropriate area to post this.