Skip to content

Instantly share code, notes, and snippets.

@twodayslate
Created August 4, 2015 15:24
Show Gist options
  • Save twodayslate/0612f6340e6d422c2b99 to your computer and use it in GitHub Desktop.
Save twodayslate/0612f6340e6d422c2b99 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Created by @bensge
cd DEBs
file=$(ls -t *.deb | head -1)
ssh user@server 'find /a/b/c/repofiles/ -name "*.deb" -exec rm -rf {} \;'
scp $file user@server:/a/b/c/repofiles/
ssh user@server 'cd /a/b/c/repofiles/ && ./repofresh'
var=$(date +"%B_%d_%kh_%Mmin")
echo $1 >> "$var.txt"
scp "$var.txt" user@server:/a/b/c/repofiles/changelog/
rm "$var.txt"
echo "$file" >> "latestVersion.txt"
ssh user@server 'find /a/b/c/repofiles/ -name "latestVersion.txt" -exec rm -rf {} \;'
scp "latestVersion.txt" user@server:/a/b/c/repofiles/
rm "latestVersion.txt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment