D4llo / surfshark-yac

Yet Another Client for Surfhark
MIT License
1 stars 1 forks source link

Add a bot to autopush to AUR #3

Closed D4llo closed 9 months ago

D4llo commented 9 months ago
  1. step detect change
  2. Edit pkg
  3. push

for the step 1 I tinkered with:


sudo tee /etc/apt/trusted.gpg.d/surfshark.asc << PGP_KEY
-----BEGIN PGP PUBLIC KEY BLOCK-----

mQGNBFxSwz0BDACoAGeNYqWGXVsHsgLCBxrEb/6n7quYf1Yu3c5rqvWshEzsCf/i
zr5z+3Yiomf515H1cQDbvz+aHzaMG4iM5rBUowZ+3E3dLr7jO1SQ9Q1olnV5vvb4
Jclp0qzNmaFrZ643wqNIzWM13RVbb88meU2Q9DzraF8OJlkS54gz/SlJlA5kUsWs
6a2zapid/EAoxZIhMaV265ycLwwA/Sh8ilrbjaTabH9xCvUywef/PDqDflzIhCYe
cS0gQFeNZe/HQp/RPwUgfqkAPhabM5xvWSYu9CvrZCIy0FlCW5ivbazZMm26fIV2
wLvczOW08e2oUCCfUSzQLqAMNIopex1bHWcXou7GvHOkgH9GltgUxId1v4x2X+YX
brjO6VMNq8689VmChwxIV5vrvarvvbA0jz5rN4pwJtFK+bSzVdIwX+je0AHvAO4S
SLyEZPdiIwteJbJJM/1a2gKpTM/Ko8Q2ItMED3/AC9gv4rIReFxsWBYBq+uzkQbL
/4r67c7fTH75mCEAEQEAAbQyU3VyZnNoYXJrIHBhY2thZ2UgbWFpbnRhaW5lciA8
YWRtaW5Ac3VyZnNoYXJrLmNvbT6JAdQEEwEKAD4CGwMFCwkIBwMFFQoJCAsFFgMC
AQACHgECF4AWIQTQD9wyISMyFScfiNwdt1kOg8j2QwUCY9pXbwUJC0n7MgAKCRAd
t1kOg8j2Q/G7C/9nZmNuXPDwilIQBeaCxlSEOsnvvU53ZJHKPc9BVrn5Br5YDUZX
3lbkopeBrfXaFQmppCIw8FBhMVsZ8ebxZ7tYX0qyNlBbq2biVYGuA/rxhLq1QFRs
yFFGHj+RdE4nFQkAgkLb84m/dZSO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MRd+inHc/ovWJu7I84deTGRf453ZnLfxOFC1L50z4mmQ2Urk5ToHfu2KIp
QGplEQnoaYpAX79mz4bdXO173IQHds14HGvH9+Az2HCi43GY0eo3xNv3MayU+Lc4
ol61gtR3WX0D4hM/HzDeCjF5q9bCGc+8oV0XZPQOetQ+5o7KtpnewUjZXcCr0vMh
mceP8qXWhrUtd4pUexw3ChKTbBbu6oOejmeMiCpiCj6VkhUO/JO037kbs48mmms9
Sw8hAz7AmVBxcnL5JmTLt38CNjdecRJUUxf48tG1lFAfEDo3FCG0sKyk2D4vNjOc
RkJcwHjawM1f9XzogikFoU3WgKujIsz5UgdTVONOxacWqQVRgzDRJR3ECBVaGuJ7
qj4kZ6DWDfj/SONmBvxaerlwnU/NNQdBOWLbmAU/UFD37faH8rUqlWv4
=bVHI
-----END PGP PUBLIC KEY BLOCK-----
PGP_KEY
echo "deb https://ocean.surfshark.com/debian stretch main" | sudo tee /etc/apt/sources.list.d/surfshark.list
sudo apt-get update
sudo apt-get install -y surfshark

sentence=$(apt-get download --print-uris surfshark)
stringarray=($sentence)

source=${stringarray[0]:1:-1}
sha512sums=${stringarray[3]:7}
pkgver=$(apt-cache show surfshark | grep Version | cut -c 10-)

cat <<-_EOT_
source=("${source}")
sha512sums=('${sha512sums}')
pkgver=${pkgver}
pkgrel=1
_EOT_

inspired by

D4llo commented 9 months ago

Ideally I would like to subscribe to a debian repository rss flux or any API.

The goal meanwhile is going to be a cron job to check for a new package a trigger the update https://jasonet.co/posts/scheduled-actions/