-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverUpgrade.sh
executable file
·137 lines (124 loc) · 11.3 KB
/
serverUpgrade.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/bin/bash
# Start the timer
start_time=$(date +%s)
curl -k -s -o /dev/null "https://rclaptimer.local/api/led/rgb?r=0&g=255&b=0" 2>/dev/null
curl -k -s -o /dev/null "https://rclaptimer.local/api/led/text?title=%20Johnny%205&message=Number%205%20alive" 2>/dev/null
curl -k -s -o /dev/null "https://rclaptimer.local/api/led/pattern?name=johnny5" 2>/dev/null
clear
echo "*******************************************"
echo "***** Johnny 5's Server UpgrayeDD!!! ******"
echo "*******************************************"
echo " "
echo " "
echo " "
echo " .:.... . ....::: "
echo " :-+*+++=+**-.. "
echo " .=+##+#===*+##=. "
echo " .++##+####*+##== "
echo " .=++**#%%%##*+=:. "
echo " . .. .#..%.+-:+##+=-. "
echo " .:*=:=. :*%##*.-=##*+=-. "
echo " .=-*:=. %*=+.:*.*###*=-. "
echo " .=*-=: .*-###-*..-@@@%*+- "
echo " .:**= .#=***=* .=@@@@%*- "
echo " .:#=: =@+#@**%+=..=@@@@%*: "
echo " .-*=. .. .:::.+@##@#%@@#*==%@@@@%+: "
echo " .-=+: ......:-=-:::=#%@#*#%+--=++==-=*##+. "
echo " .-+**=++=-==+*#***+=++++**#*++***===+*=++-. "
echo " .+#*#*+=--::--+*##=-----++%#####%****#*+=:. "
echo " ....:.. .:::=*=*#*#%@@%%%#=-=++=-.. "
echo " -*###**#%@@@#+---+%*: "
echo " .:*##**+*%@@@#---=**=. "
echo " +**##*++#@@#-::-=+-. "
echo " .++######%@%**+---. "
echo " .+*%%#%#%%@#=++::. "
echo " .:+%*##*@%#*++-.. "
echo " .*#**%+##*##*==: "
echo " -+==+=**+++++-:. "
echo " .-=====+=--:.. "
echo " -++=+=+-*=. "
echo " .. .-+===+***---:.. "
echo " ...-::--=*+*#%%+*+----:. "
echo " .........................:+*#+--==%+@=@@#+@%*==-===-.. "
echo " .......................................-***#-:.-=%@*#*@@+++#*#*#*-:::.... "
echo "...........................................:=***%@=.. ....:-++-=*####*-::::::......................... "
echo ".........................................-+**#@@@@*====---##%****##==::::::::......................................"
echo ".......................................:-**#%@##%####*****%#***#*-:-=:::::::::....................................."
echo ".............................::::::::::-+##%@@%%%%@@@@@@#+#+*#*-------:::::::::::::................................"
echo "..........................:::::::::::---+#%%%@@@@@@@@@@@%###*%::-:::--::-=++----:::::::............................"
echo "............................::::::::::--=+*****######%%%@####%---++*###%##*+=--:::::::::..........................."
echo ".................................:::::::::::::------===++*#%%%%**#*++==----::::::::::.............................."
echo "............................................::::::::::::::::--::::::::::::::......................................."
sleep 2
echo "*** UpgrayeDD Prisma Generate!"
curl -k -s -o /dev/null "https://rclaptimer.local/api/led/text?title=%20Johnny%205&message=prisma%20generate" 2>/dev/null
npx prisma generate
sleep 2
echo "*** UpgrayeDD deleted files!"
curl -k -s -o /dev/null "https://rclaptimer.local/api/led/text?title=%20Johnny%205&message=deleted%20files" 2>/dev/null
rm -rf .next
rm rc-lap-timer-build.tar.gz
sleep 2
echo "*** UpgrayeDD build!"
curl -k -s -o /dev/null "https://rclaptimer.local/api/led/text?title=%20Johnny%205&message=npm%20run%20build" 2>/dev/null
npm run build
sleep 2
echo "*** UpgrayeDD Prisma Generate!"
curl -k -s -o /dev/null "https://rclaptimer.local/api/led/text?title=%20Johnny%205&message=prisma%20generate%20again" 2>/dev/null
npx prisma generate
sleep 2
echo "*** UpgrayeDD tar!"
curl -k -s -o /dev/null "https://rclaptimer.local/api/led/text?title=%20Johnny%205&message=tarring" 2>/dev/null
sleep 2
tar -czf rc-lap-timer-build.tar.gz * .next package.json package-lock.json node_modules public
echo "*** UpgrayeDD pi file!"
curl -k -s -o /dev/null "https://rclaptimer.local/api/led/text?title=%20Johnny%205&message=sending%20to%20Pi" 2>/dev/null
sleep 2
sshpass -p 'rclaptimer' scp rc-lap-timer-build.tar.gz pi@rclaptimer.local:~
sleep 2
# End the timer
end_time=$(date +%s)
# Calculate the time difference
time_diff=$((end_time - start_time))
# Convert to minutes and seconds for readability
minutes=$((time_diff / 60))
seconds=$((time_diff % 60))
echo "--------------------------------=--------------------------------------=++*=---------------------------------------"
echo "--------------------------------******++==-----------------------=+**##%%%#=---------------------------------------"
echo "--------------------------------*#%%##**********###*###%***+***##%%%#+=--------------------------------------------"
echo "---------------------------------=++===+#%%#######+##***+###%%%##*+=-----------------------------------------------"
echo "-------------------------------------=++*#@@@@@%%#*###%%**@@@@@@@%####+--------------------------------------------"
echo "---------------------------------+**##**#**#@@@@@#++++++++%@@@@#**##****+------------------------------------------"
echo "---------------------------------=*#**%@@@%#**%@@%********%%@%**@@@@@%***------------------------------------------"
echo "--------------------------------+****@@@@@@@@*%@@%########%@@#*@@@@%@@@**=-----------------------------------------"
echo "--------------------------------+#%*#@@@@@@@@*#%%@%%%%%%%%%%%#*@@@@@@@@*#*-----------------------------------------"
echo "--------------------------------#%##*%@@@@@@**%%%%%%%%%%%%%%%@**@@@@@%***#-----------------------------------------"
echo "--------------------------------#%*##**###**#%%#############%%%%******#**#-----------------------------------------"
echo "--------------------------------#%**###%%%%%%%%%##****#####%%%@@@@%%####*%-----------------------------------------"
echo "--------------------------------=+*##%%%%%#####%@@@@@@@@@@@@%%%%%######*=------------------------------------------"
echo "-------------------------------------**+=-=+@%%%@@@@@@@@@@@%##=@@-----%###***+++++---------------------------------"
echo "--------------------------------------------%#****++##*++=+%%#=@@----+%%%%%####++++--------------------------------"
echo "--------------------------------------------=%%*---=@@----#%%=+@#----=%%%%#####+=+++-------------------------------"
echo "---------------------------------------------*%%+%@@@@@@*+%%+-%@=-----%%%%#####*+=++=------------------------------"
echo "----------------------------------------------#%@#@%%@%@@@%#-*@%------%%%%%%%%%#+*++*------------------------------"
echo "-----------------------------------------------#@@%%###@@@%--@@=------%%%%%%%%%%#*#**+-----------------------------"
echo "-----------------------------------------------+@%##*+*##%%-@@*-------%@%%%%%%%%%##+++=----------------------------"
echo "-----------------------------------------------#@@##*+*##%+@@#--------@@@%%%%%%%%@%+**+=---------------------------"
echo "----------------------------------------------+##@##*+*##%%@@---------%@@@@@@@@@%@@****+---------------------------"
echo "-------------------------------------------=@%#%%@*####%#%#%@@+--------@@@@@@@@@@@@@*****--------------------------"
echo "-------------------------------------------=@@#++*##*##*%#*+*@=--------=@@@@@@@@@@@@%**#*+-------------------------"
echo "--------------------------------------------%@=++#***#*####*#@----------+@@@@@@@@@@@@#*@%*=------------------------"
echo "-----------------------------------------%@%@@+###++*#%***##%@-----------*@@@@@@@@@@@@%@@#*------------------------"
echo "-----------------------------------------%@@@@=-*##%%%%%###+@@==----------@@@@@@@@@@@@@@%%#*-----------------------"
echo "-----------------------------------------@@@@@=-#@%%@@@%%%%%@@@%*+*#=------@@@@@@@@@@@@@@@%*+----------------------"
echo "-----------------------------------------@@#@@+*%%%%@@@%%%%@@@@@@#%%@#------@@@@@@@@@@@@@%@%*----------------------"
echo "------------------------------=-==-------%@%@@%%%%%%@@@%%%%@@@@@@@%%@@@=----+@@@@@@@@@@@@@%@#*---------------------"
echo "----------------+=--+=++++====++++++++++*##%@@@%%%%%@@@%%%%%@@@@@@@@@@@@%+--%@@@@@@@@@@@@@%@%#+--------------------"
echo "--------------=====-+++=+#@@#**+=--=#-----*@@@@@%%%%@@@%%%%@@@@@@#*####%%%*%@@@@@@@@@%%@@@@%@@*=-------------------"
echo "-------------+++=+-=+#==+%#==+=+%*-------+%@@%##@@%%@@@@%%@%@@@@%%%%###@##########@@@%%@@@@@@%%+-------------------"
echo "*** Tell UpgrayeDD the server UpgrayyeDD is done!"
echo "UpgrayeDD took $minutes minutes and $seconds seconds."
echo " -- Love Johnny5"
curl -k -s -o /dev/null "https://rclaptimer.local/api/led/text?title=%20Johnny%205&message=Server%20UpgrayeDD%20%20%20%20%20Complete" 2>/dev/null
curl -k -s -o /dev/null "https://rclaptimer.local/api/led/pattern?name=johnny5" 2>/dev/null
curl -k -s -o /dev/null "https://rclaptimer.local/api/led/rgb?r=255&g=0&b=0" 2>/dev/null