#!/usr/bin/env bash repo="aristocratos/bashtop" current=$(reprepro -b /var/www/repos/apt/debian list stable bashtop | head -n1 | awk '{print $3}') if [[ ! -d /tmp/bashtop ]]; then git clone https://github.com/$repo /tmp/bashtop else cd /tmp/bashtop git fetch tp=$(git pull) fi cd /tmp/bashtop new=$(grep 'declare version=' bashtop | cut -d '"' -f 2) if [ "$current" == "$new" ]; then exit fi echo "New BASHTOP version $current -> $new" STARTDIR="/tmp/bashtop/build" DESTDIR="$STARTDIR/pkg" OUTDIR="$STARTDIR/deb" rm -rf "$STARTDIR" mkdir "$STARTDIR" install -Dm 755 "/tmp/bashtop/bashtop" "$DESTDIR/usr/bin/bashtop" mkdir -p "$DESTDIR/DEBIAN" cat >"$DESTDIR/DEBIAN/control"< Description: Linux resource monitor in Bash Homepage: https://github.com/aristocratos/bashtop Bugs: https://github.com/aristocratos/bashtop/issues EOL mkdir "$OUTDIR" dpkg-deb --build "$DESTDIR" "$OUTDIR" reprepro -b /var/www/repos/apt/debian includedeb stable "$OUTDIR"/*.deb reprepro -b /var/www/repos/apt/debian includedeb oldstable "$OUTDIR"/*.deb rm -rf "$STARTDIR"