Skip to content

Commit

Permalink
make download and verify nextcloud a function
Browse files Browse the repository at this point in the history
  • Loading branch information
enoch85 committed Apr 8, 2017
1 parent 59e50d2 commit d7e9c1b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
10 changes: 10 additions & 0 deletions lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,16 @@ calc_wt_size() {
export WT_MENU_HEIGHT
}

download_verify_nextcloud_stable() {
wget -q -T 10 -t 2 "$NCREPO/$STABLEVERSION.tar.bz2" -P "$HTML"
mkdir -p "$GPGDIR"
wget -q "$NCREPO/$STABLEVERSION.tar.bz2.asc" -P "$GPGDIR"
chmod -R 600 "$GPGDIR"
gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$OpenPGP_fingerprint"
gpg --verify "$GPGDIR/$STABLEVERSION.tar.bz2.asc" "$HTML/$STABLEVERSION.tar.bz2"
rm -r "$GPGDIR"
}

# Initial download of script in ../static
# call like: download_static_script name_of_script
download_static_script() {
Expand Down
9 changes: 1 addition & 8 deletions nextcloud_install_production.sh
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,7 @@ check_command apt install -y \
apt install open-vm-tools -y

# Download and validate Nextcloud package
wget -q -T 10 -t 2 "$NCREPO/$STABLEVERSION.tar.bz2" -P "$HTML"
mkdir -p "$GPGDIR"
wget -q "$NCREPO/$STABLEVERSION.tar.bz2.asc" -P "$GPGDIR"
chmod -R 600 "$GPGDIR"
gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$OpenPGP_fingerprint"
check_command gpg --verify "$GPGDIR/$STABLEVERSION.tar.bz2.asc" "$HTML/$STABLEVERSION.tar.bz2"
# Cleanup
rm -r $GPGDIR
check_command download_verify_nexcloud_stable

if [ -f "$HTML/$STABLEVERSION.tar.bz2" ]
then
Expand Down
9 changes: 1 addition & 8 deletions nextcloud_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,7 @@ else
fi

# Download and validate Nextcloud package
wget -q -T 10 -t 2 "$NCREPO/$STABLEVERSION.tar.bz2" -P "$HTML"
mkdir -p "$GPGDIR"
wget -q "$NCREPO/$STABLEVERSION.tar.bz2.asc" -P "$GPGDIR"
chmod -R 600 "$GPGDIR"
gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$OpenPGP_fingerprint"
check_command gpg --verify "$GPGDIR/$STABLEVERSION.tar.bz2.asc" "$HTML/$STABLEVERSION.tar.bz2"
# Cleanup
rm -r $GPGDIR
check_command download_verify_nextcloud_stable

if [ -f "$HTML/$STABLEVERSION.tar.bz2" ]
then
Expand Down

0 comments on commit d7e9c1b

Please sign in to comment.