You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.3 KiB
Bash

# Copyright (C) 2022 Kamal Curi
# Full license inside the manual at doc/
#!/usr/bin/env bash
version="1.31"
echo "Steelbox V$version, Copyright (C) 2022 Kamal Curi"
echo "Steelbox comes with ABSOLUTELY NO WARRANTY; For license details, read the manual in doc/"
if [ -f /tmp/steelbox.pid ]
then
echo "There is a temporary PID file in /tmp/, which means that"
echo "either there's an open instance of steelbox, or it"
echo "hasn't properly quit. To avoid manipulating the password"
echo "file improperly, steelbox will not open. If you're sure"
echo "there are no open steelbox processes, remove"
echo "/tmp/steelbox.pid and try again"
exit 1
else
echo $$ > steelbox.pid
fi
if [ -f $HOME/.pasfile.csv.gpg ]
then
gpg $HOME/.pasfile.csv.gpg &> /dev/null
if [ $? -gt 0 ]
then
echo WRONG PASSWORD!
exit 1
fi
rm $HOME/.pasfile.csv.gpg
else
echo ERROR: NO ENCRYPTED PASSWORD FILE FOUND
echo STEELBOX WILL ATTEMPT TO OPEN UNENCRYPTED FILE
echo PRESS ENTER TO CONTINUE.
read
fi
python3 /opt/steelbox.py $version
rm /tmp/steelbox.pid
gpg -c --no-symkey-cache --cipher-algo AES256 $HOME/.pasfile.csv
if [ $? -gt 0 ]
then
echo ERROR ENCRYPTING PASSWORD FILE!
echo UNENCRYPTED FILE IN $HOME/.pasfile.csv
echo PRESS ENTER TO QUIT
read
exit 1
fi
rm $HOME/.pasfile.csv