generalize luserinstall script to work with any deb package

This commit is contained in:
fram3d 2024-01-17 15:40:19 +01:00
parent 702c8f7bf7
commit f1c39a5cf0
Signed by: fram3d
GPG Key ID: 938920E709EEA32A
2 changed files with 25 additions and 17 deletions

View File

@ -0,0 +1,25 @@
#!/bin/bash
## Install luser.deb to remote host
DMZKEYFILE=$(echo -n ~)"/.ssh/dmz"
HOST="$1"
DEB="$2"
if [[ -z "$HOST" ]]; then
echo "Set Luser Host"
echo "Usage: ./installdeb.sh HOSTNAME DEB_FILE"
exit 1
fi
if [[ -z "$DEB" ]]; then
echo "Set Deb package name"
echo "Usage: ./installdeb.sh HOSTNAME DEB_FILE"
exit 1
fi
cd ~/src/$DEB/build-deb
make
ssh-add -t 100 $DMZKEYFILE
torsocks scp $DEB.deb $HOST:~/
torsocks ssh $HOST "apt install -y /root/$DEB.deb ; rm /root/$DEB.deb"

View File

@ -1,17 +0,0 @@
#!/bin/bash
## Install luser.deb to remote host
DMZKEYFILE=$(echo -n ~)"/.ssh/dmz"
HOST="$1"
if [[ -z "$HOST" ]]; then
echo "Set Luser Host"
exit 1
fi
cd ~/src/luser/build-deb
make
ssh-add -t 100 $DMZKEYFILE
torsocks scp luser.deb $HOST:~/
torsocks ssh $HOST "apt install -y /root/luser.deb ; rm /root/luser.deb"