mirror of
https://git.envs.net/envs/matrix-conf.git
synced 2025-05-18 07:20:40 -04:00
rename update_riot script
This commit is contained in:
parent
baecabda4d
commit
3571cff740
2 changed files with 16 additions and 15 deletions
|
@ -2,7 +2,7 @@
|
||||||
set -e -u
|
set -e -u
|
||||||
|
|
||||||
token=''
|
token=''
|
||||||
domain='matrix.envs.net'
|
domain=''
|
||||||
username='matrix'
|
username='matrix'
|
||||||
db='matrix'
|
db='matrix'
|
||||||
file="$HOME/nukeusers.txt"
|
file="$HOME/nukeusers.txt"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
[[ ! -d /opt/Riot/resources ]] && mkdir -p /opt/Riot/resources
|
|
||||||
cd /opt/Riot/resources
|
[[ ! -d /opt/element/resources ]] && mkdir -p /opt/element/resources
|
||||||
|
cd /opt/element/resources
|
||||||
|
|
||||||
old_version="v$(cat webapp/version)"
|
old_version="v$(cat webapp/version)"
|
||||||
|
|
||||||
|
@ -19,27 +20,27 @@ if [[ "$new_version" == "$old_version" ]]; then
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove previous backup riot
|
# Remove previous backup element
|
||||||
rm -rf riot.bak
|
rm -rf element.bak
|
||||||
|
|
||||||
# Create temp directory for new riot
|
# Create temp directory for new element
|
||||||
mkdir riot.new
|
mkdir element.new
|
||||||
cd riot.new
|
cd element.new
|
||||||
|
|
||||||
echo "Downloading Riot $new_version"
|
echo "Downloading element $new_version"
|
||||||
curl -L "$URL" -o riot-tmp.tar.gz
|
curl -L "$URL" -o element-tmp.tar.gz
|
||||||
|
|
||||||
echo "Unpacking archive"
|
echo "Unpacking archive"
|
||||||
tar -xzf riot-tmp.tar.gz --strip-components=1
|
tar -xzf element-tmp.tar.gz --strip-components=1
|
||||||
rm -f riot-tmp.tar.gz
|
rm -f element-tmp.tar.gz
|
||||||
|
|
||||||
echo "Replacing files"
|
echo "Replacing files"
|
||||||
cd ..
|
cd ..
|
||||||
cp -f webapp/config.json riot.new/config.json
|
cp -f webapp/config.json element.new/config.json
|
||||||
# Back up old version and activate new version
|
# Back up old version and activate new version
|
||||||
mv webapp webapp.bak
|
mv webapp webapp.bak
|
||||||
mv riot.new webapp
|
mv element.new webapp
|
||||||
|
|
||||||
echo "Updated to Riot from $old_version to $new_version"
|
echo "Updated to element from $old_version to $new_version"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue