-
Notifications
You must be signed in to change notification settings - Fork 0
/
first.sh
executable file
·55 lines (52 loc) · 1.29 KB
/
first.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
# this file is subject to Licence
#Copyright (c) 2024, Acktarius
##################################################################
# get credentials
##################################################################
#Declaratons
bold=$(tput bold)
normal=$(tput sgr0)
#Working directory
wdir="/opt/avalauto"
cd $wdir
#main
if [[ -f credentialsgpg ]]; then
echo -e "credentials encrypted file already exist \ndelete it with ${bold}'sudo rm -f credentialsgpg'\n \
${normal}and come back visit this script"
sleep 2
exit
else
value=$(zenity --username --password --timeout=25)
case $? in
0)
u=$(echo $value | cut -d "|" -f 1)
p=$(echo $value | cut -d "|" -f 2)
if ([[ -z $u ]] || [[ -z $p ]]); then
echo "we don't deal with emptiness"; sleep 2;
zenity --warning --timeout=12 --text="one or both of the entry is empty" &
exit
else
echo "username=$u&passwd=$p" | gpg -c > credentialsgpg
fi
;;
1)
echo "nothing done bye!"
zenity --info --timeout=12 --text="nothing done bye!" &
sleep 1
exit
;;
*)
echo "something went wrong"
;;
esac
#launch second?
if [[ ! -f .data ]]; then
if $(zenity --question --text="No IP address recorded for miner\nDo you want to set up one?"); then
source second.sh
else
zenity --info --timeout=12 --text="Up to you, but you'll need one at some point" &
fi
fi
fi
exit