├── .gitignore ├── LICENSE ├── README.md ├── functions ├── cloneclean.sh ├── clonestartoutput.sh ├── createsdrive.sh ├── deploy.sh ├── deploylocal.sh ├── deploysdrive.sh ├── deploytransfer.sh ├── emails.sh ├── exclude ├── functions.sh ├── gaccount.sh ├── keyback.sh ├── keys.sh ├── keysbuild.sh ├── mountnumbers.sh ├── multihd.sh ├── oauth.sh ├── oauthcheck.sh ├── passwords.sh ├── pgclone.sh ├── projectname.sh ├── publicsecret.sh ├── rcloneinstall.sh ├── transportselect.sh ├── uagent.sh └── variables.sh ├── mounts ├── crypt.service ├── drive.service ├── pgunity.service └── transfer.service ├── pgclone.json ├── pgclone.sh ├── place.holder ├── rclone.yml ├── roles ├── .DS_Store └── rcloneinstall │ ├── .travis.yml │ ├── README.md │ ├── defaults │ └── main.yml │ ├── meta │ └── main.yml │ ├── tasks │ └── main.yml │ ├── tests │ ├── inventory │ └── test.yml │ └── vars │ ├── CentOS-6.yml │ ├── Debian.yml │ ├── Linuxmint.yml │ ├── RedHat.yml │ └── Ubuntu.yml ├── source ├── cloneclean.sh ├── local.sh ├── loop.sh ├── pgblitz.sh ├── pgunity.sh └── transfer.sh ├── templates ├── edit-gc ├── edit-gd ├── edit-pgunity ├── edit-rclone ├── edit-sc ├── edit-sd ├── edit-transport ├── status-gc ├── status-gd ├── status-pgblitz ├── status-pgunity ├── status-rclone ├── status-sc ├── status-sd └── status-transport └── ymls ├── alias.yml ├── crypt.yml ├── local.yml ├── mount.yml ├── pgunity.yml └── remove.yml /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PGBlitz-PGClone 2 | 3 | ##### WANT TO HELP? CLICK THE ★ (STAR LOGO) in the Upper-Right! 4 |

5 | 6 | 7 | 8 | 9 |

10 | 11 | * 📂 [**[Click Here]**](https://goo.gl/7NR3Da) - Google G-Suite (Unlimited Hard Drive Space & Storage) 12 | * 📂 [**[Click Here]**](https://controlpanel.newshosting.com/signup/index.php?promo=partners&a_aid=5a65169240efd&a_bid=5ecfe99b) - Top Performance NewsHost! - Blitz Members Receive a 58% Discount 13 | ---- 14 | ### **Reference Shortcut -** http://wiki.pgblitz.com | Discord ( !wiki ) 15 | ---- 16 | 17 | ## 1. PG YouTube 18 | 19 |

20 |

PGBlitz Introduction Video

21 | 22 |

23 |

PGBlitz Installation Video

24 | 25 | [**[Click Here]**](https://pgblitz.com/threads/plexguide-install-instructions.243/) for installation instructions to start the process 26 | -------------------------------------------------------------------------------- /functions/cloneclean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | cloneclean () { 9 | pgclonevars 10 | 11 | tee <<-EOF 12 | 13 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14 | 🚀 Clone Clean 15 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16 | 17 | Clone Clean deletes garbage files in your downloads folder per every 18 | [$cloneclean] minutes! 19 | 20 | TORRENT USERS: Recommend that you set this number higher! If seeding, 21 | Clone Clean will destory the seed files. Please set this number to a high 22 | number of minutes. (IE - 1440 minutes = 1 day | 14440 minutes = 10 days) 23 | 24 | WARNING: Do not set this too low because legitmate files! 25 | 26 | Quitting? Type >>> exit 27 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 28 | EOF 29 | read -p '↘️ Type Minutes (Minimum is 120) | PRESS [ENTER]: ' varinput < /dev/tty 30 | if [[ "$varinput" == "exit" || "$varinput" == "Exit" || "$varinput" == "EXIT" ]]; then clonestart; fi 31 | 32 | if [[ "$varinput" -lt "120" ]]; then cloneclean; fi 33 | 34 | echo "$varinput" > /pg/var/cloneclean 35 | } 36 | -------------------------------------------------------------------------------- /functions/clonestartoutput.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | clonestartoutput () { 9 | pgclonevars 10 | 11 | echo "ACTIVELY DEPLOYED: [$dversionoutput]" 12 | echo "" 13 | 14 | if [[ "$demo" == "ON " ]]; then mainid="********"; else mainid="$pgcloneemail"; fi 15 | 16 | if [[ "$transport" == "gd" ]]; then 17 | tee <<-EOF 18 | [1] Client ID & Secret [${pgcloneid}] 19 | [2] GDrive [$gdstatus] 20 | EOF 21 | elif [[ "$transport" == "gc" ]]; then 22 | tee <<-EOF 23 | [1] Client ID & Secret [${pgcloneid}] 24 | [2] Passwords [$pstatus] 25 | [3] GDrive [$gdstatus] - [$gcstatus] 26 | EOF 27 | elif [[ "$transport" == "sd" ]]; then 28 | tee <<-EOF 29 | [1] Google Account Login [$mainid] 30 | [2] Project Name [$pgcloneproject] 31 | [3] Client ID & Secret [${pgcloneid}] 32 | [4] SDrive Label [$sdname] 33 | [5] SDrive OAuth [$sdstatus] 34 | [6] GDrive OAuth [$gdstatus] 35 | [7] Key Management [$displaykey] Built 36 | [8] SDrive (E-Mail Share Generator) 37 | EOF 38 | elif [[ "$transport" == "sc" ]]; then 39 | tee <<-EOF 40 | [1] Google Account Login [$mainid] 41 | [2] Project Name [$pgcloneproject] 42 | [3] Client ID & Secret [${pgcloneid}] 43 | [4] Passwords [$pstatus] 44 | [5] SDrive Label [$sdname] 45 | [6] SDrive | SDrive [$sdstatus] - [$scstatus] 46 | [7] GDrive | GCrypt [$gdstatus] - [$gcstatus] 47 | [8] Key Management [$displaykey] Built 48 | [9] SDrive (E-Mail Share Generator) 49 | EOF 50 | elif [[ "$transport" == "le" ]]; then 51 | tee <<-EOF 52 | NOTE: The default drive is already factored in! Only additional locations 53 | or hard drives are required to be added! 54 | EOF 55 | fi 56 | } 57 | 58 | errorteamdrive () 59 | 60 | { 61 | if [[ "$sdname" == "NOT-SET" ]]; then 62 | tee <<-EOF 63 | 64 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 65 | 🚀 Setup the SDrive Label First! ~ http://pgclone.pgblitz.com 66 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 67 | 68 | NOTE: Set up your SDrive Label prior to executing the SDrive OAuth. 69 | Basically, we cannot authorize a ShareDrive without knowing which 70 | ShareDrive is being utilized first! 71 | 72 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 73 | EOF 74 | read -rp '↘️ Acknowledge Info | Press [ENTER] ' typed < /dev/tty 75 | clonestart 76 | fi 77 | } 78 | 79 | clonestart () { 80 | pgclonevars 81 | 82 | # pull throttle speeds based on role 83 | if [[ "$transport" == "gd" || "$transport" == "gc" ]]; then 84 | throttle=$(cat /pg/var/move.bw) 85 | output1="[C] Transport Select" 86 | else 87 | throttle=$(cat /pg/var/blitz.bw) 88 | output1="[C] Options" 89 | fi 90 | 91 | if [[ "$transport" != "gd" && "$transport" != "gc" && "$transport" != "sd" && "$transport" != "sc" && "$transport" != "le" ]]; then 92 | rm -rf /pg/rclone/pgclone.transport 1>/dev/null 2>&1 93 | mustset; fi 94 | 95 | if [[ "$transport" == "gd" ]]; then outputversion="GDrive Unencrypted" 96 | elif [[ "$transport" == "gc" ]]; then outputversion="GDrive Encrypted" 97 | elif [[ "$transport" == "sd" ]]; then outputversion="SDrive Unencrypted" 98 | elif [[ "$transport" == "sc" ]]; then outputversion="SDrive Encrypted" 99 | elif [[ "$transport" == "le" ]]; then outputversion="Local Hard Drives" 100 | fi 101 | 102 | if [[ "$transport" == "le" ]]; then 103 | tee <<-EOF 104 | 105 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 106 | 💪 Welcome to PG Clone ~ http://pgclone.pgblitz.com 107 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 108 | EOF 109 | clonestartoutput 110 | 111 | tee <<-EOF 112 | 113 | [1] Deploy (Local HD/Mounts) 114 | [2] MultiHD (Add Mounts xor Hard Drives) 115 | [3] Transport (Change Transportion Mode) 116 | [Z] Exit 117 | 118 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 119 | EOF 120 | read -rp '↘️ Input Selection | Press [ENTER]: ' typed < /dev/tty 121 | 122 | localstartoutput 123 | 124 | else 125 | tee <<-EOF 126 | 127 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 128 | 💪 Welcome to PG Clone ~ http://pgclone.pgblitz.com 129 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 130 | EOF 131 | clonestartoutput 132 | 133 | tee <<-EOF 134 | 135 | [A] Deploy $outputversion 136 | [B] Throttle [${throttle} MB] 137 | [C] Options 138 | [Z] Exit 139 | 140 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 141 | EOF 142 | read -rp '↘️ Input Selection | Press [ENTER]: ' typed < /dev/tty 143 | clonestartactions 144 | fi 145 | } 146 | 147 | localstartoutput () { 148 | case $typed in 149 | 1 ) 150 | executelocal ;; 151 | 2 ) 152 | bash /pg/pgblitz/menu/pgcloner/multihd.sh ;; 153 | 3 ) 154 | transportselect ;; 155 | z ) 156 | exit ;; 157 | Z ) 158 | exit ;; 159 | * ) 160 | clonestart ;; 161 | esac 162 | clonestart 163 | } 164 | 165 | clonestartactions () { 166 | if [[ "$transport" == "gd" ]]; then 167 | case $typed in 168 | 1 ) 169 | keyinputpublic ;; 170 | 2 ) 171 | publicsecretchecker 172 | echo "gd" > /pg/rclone/deploy.version 173 | oauth ;; 174 | z ) 175 | exit ;; 176 | Z ) 177 | exit ;; 178 | a ) 179 | publicsecretchecker 180 | mountchecker 181 | deploygdrive 182 | ;; ## fill 183 | A ) 184 | publicsecretchecker 185 | mountchecker 186 | deploygdrive 187 | ;; ## flll 188 | b ) 189 | setthrottlemove ;; 190 | B ) 191 | setthrottlemove ;; 192 | c ) 193 | optionsmengu ;; 194 | C ) 195 | optionsmengu ;; 196 | * ) 197 | clonestart ;; 198 | esac 199 | elif [[ "$transport" == "gc" ]]; then 200 | case $typed in 201 | 1 ) 202 | keyinputpublic ;; 203 | 2 ) 204 | publicsecretchecker 205 | blitzpasswordmain ;; 206 | 3 ) 207 | publicsecretchecker 208 | passwordcheck 209 | echo "gd" > /pg/rclone/deploy.version 210 | oauth ;; 211 | z ) 212 | exit ;; 213 | Z ) 214 | exit ;; 215 | a ) 216 | publicsecretchecker 217 | passwordcheck 218 | mountchecker 219 | deploygdrive 220 | ;; ## fill 221 | A ) 222 | publicsecretchecker 223 | passwordcheck 224 | mountchecker 225 | deploygdrive 226 | ;; ## flll 227 | b ) 228 | setthrottlemove ;; 229 | B ) 230 | setthrottlemove ;; 231 | c ) 232 | optionsmengu ;; 233 | C ) 234 | optionsmengu ;; 235 | * ) 236 | clonestart ;; 237 | esac 238 | elif [[ "$transport" == "sd" ]]; then 239 | case $typed in 240 | 1 ) 241 | glogin ;; 242 | 2 ) 243 | exisitingproject ;; 244 | 3 ) 245 | keyinputpublic ;; 246 | 4 ) 247 | publicsecretchecker 248 | tlabeloauth ;; 249 | 5 ) 250 | publicsecretchecker 251 | tlabelchecker 252 | echo "sd" > /pg/rclone/deploy.version 253 | oauth ;; 254 | 6 ) 255 | publicsecretchecker 256 | echo "gd" > /pg/rclone/deploy.version 257 | oauth ;; 258 | 7 ) 259 | publicsecretchecker 260 | tlabelchecker 261 | mountchecker 262 | projectnamecheck 263 | keystart 264 | gdsaemail ;; 265 | 8 ) 266 | publicsecretchecker 267 | tlabelchecker 268 | mountchecker 269 | projectnamecheck 270 | deployblitzstartcheck 271 | emailgen ;; 272 | z ) 273 | exit ;; 274 | Z ) 275 | exit ;; 276 | a ) 277 | publicsecretchecker 278 | tlabelchecker 279 | mountchecker 280 | deploysdrive 281 | ;; ## fill 282 | A ) 283 | publicsecretchecker 284 | tlabelchecker 285 | mountchecker 286 | deploysdrive 287 | ;; ## flll 288 | b ) 289 | setthrottleblitz ;; 290 | B ) 291 | setthrottleblitz ;; 292 | c ) 293 | optionsmenu ;; 294 | C ) 295 | optionsmenu ;; 296 | d ) 297 | mountnumbers ;; 298 | D ) 299 | mountnumbers ;; 300 | * ) 301 | clonestart ;; 302 | esac 303 | elif [[ "$transport" == "sc" ]]; then 304 | case $typed in 305 | 1 ) 306 | glogin ;; 307 | 2 ) 308 | exisitingproject ;; 309 | 3 ) 310 | keyinputpublic ;; 311 | 4 ) 312 | publicsecretchecker 313 | blitzpasswordmain ;; 314 | 5 ) 315 | publicsecretchecker 316 | tlabeloauth ;; 317 | 6 ) 318 | publicsecretchecker 319 | passwordcheck 320 | tlabelchecker 321 | echo "sc" > /pg/rclone/deploy.version 322 | oauth ;; 323 | 7 ) 324 | publicsecretchecker 325 | passwordcheck 326 | echo "sc" > /pg/rclone/deploy.version 327 | oauth ;; 328 | 329 | 8 ) 330 | publicsecretchecker 331 | passwordcheck 332 | tlabelchecker 333 | mountchecker 334 | projectnamecheck 335 | keystart 336 | gdsaemail ;; 337 | 9 ) 338 | publicsecretchecker 339 | passwordcheck 340 | tlabelchecker 341 | mountchecker 342 | projectnamecheck 343 | deployblitzstartcheck 344 | emailgen ;; 345 | z ) 346 | exit ;; 347 | Z ) 348 | exit ;; 349 | a ) 350 | publicsecretchecker 351 | passwordcheck 352 | tlabelchecker 353 | mountchecker 354 | deploysdrive 355 | ;; ## fill 356 | A ) 357 | publicsecretchecker 358 | passwordcheck 359 | tlabelchecker 360 | mountchecker 361 | deploysdrive 362 | ;; ## flll 363 | b ) 364 | setthrottleblitz ;; 365 | B ) 366 | setthrottleblitz ;; 367 | c ) 368 | optionsmenu ;; 369 | C ) 370 | optionsmenu ;; 371 | d ) 372 | mountnumbers ;; 373 | D ) 374 | mountnumbers ;; 375 | * ) 376 | clonestart ;; 377 | esac 378 | fi 379 | clonestart 380 | } 381 | 382 | # For Blitz 383 | optionsmenu () { 384 | pgclonevars 385 | tee <<-EOF 386 | 387 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 388 | 💪 Options Interface ~ http://pgclone.pgblitz.com 389 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 390 | 391 | [1] Transport Select | Change Transport Type 392 | [2] RClone Mount Settings | Change Varibles to for the Mount 393 | [3] Multi-HD Option | Add Multi-Points and Options 394 | [4] Destroy All Service Keys | Wipes All Keys for the Project 395 | [5] Create New Project | Wipes Resets Everything 396 | [6] Demo Mode | Hide Displaying the E-Mail Address - ${demo} 397 | [7] Clone Clean | Destory Garbage Files - After [$cloneclean]M 398 | [8] Change User Agent | Currently: ${uagent} 399 | [9] Create a Share Drive 400 | [Z] Exit 401 | 402 | NOTE: Creating NEW PROJECT [9]? User must create a CLIENT ID & SECRET for 403 | that project! We will assist in creating the project and enabling the API! 404 | 405 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 406 | EOF 407 | read -rp '↘️ Input Selection | Press [ENTER]: ' typed < /dev/tty 408 | 409 | case $typed in 410 | 1 ) 411 | transportselect 412 | clonestart ;; 413 | 2 ) 414 | mountnumbers ;; 415 | 3 ) 416 | bash /pg/pgblitz/menu/pgcloner/multihd.sh ;; 417 | 4 ) 418 | deletekeys ;; 419 | 5 ) 420 | projectnameset ;; 421 | 6 ) 422 | demomode ;; 423 | 7 ) 424 | cloneclean ;; 425 | 8 ) 426 | uagent ;; 427 | 9 ) 428 | csdrive ;; 429 | Z ) 430 | clonestart ;; 431 | z ) 432 | clonestart ;; 433 | * ) 434 | optionsmenu ;; 435 | esac 436 | optionsmenu 437 | } 438 | 439 | # For Move 440 | optionsmengu () { 441 | pgclonevars 442 | tee <<-EOF 443 | 444 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 445 | 💪 Options Interface ~ http://pgclone.pgblitz.com 446 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 447 | 448 | [1] Transport Select | Change Transport Type 449 | [2] RClone Mount Settings | Change Varibles to for the Mount 450 | [3] Multi-HD Option | Add Multi-Points and Options 451 | [4] Clone Clean | Destory Garbage Files - After [$cloneclean]M 452 | [5] Change User Agent - ${uagent} 453 | [Z] Exit 454 | 455 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 456 | EOF 457 | read -rp '↘️ Input Selection | Press [ENTER]: ' typed < /dev/tty 458 | 459 | case $typed in 460 | 1 ) 461 | transportselect 462 | clonestart ;; 463 | 2 ) 464 | mountnumbers ;; 465 | 3 ) 466 | bash /pg/pgblitz/menu/pgcloner/multihd.sh ;; 467 | 4 ) 468 | cloneclean ;; 469 | 5 ) 470 | uagent ;; 471 | Z ) 472 | clonestart ;; 473 | z ) 474 | clonestart ;; 475 | * ) 476 | optionsmenu ;; 477 | esac 478 | optionsmenu 479 | } 480 | 481 | demomode () { 482 | if [[ "$demo" = "OFF" ]]; then echo "ON " > /pg/rclone/pgclone.demo 483 | else echo "OFF" > /pg/rclone/pgclone.demo; fi 484 | 485 | pgclonevars 486 | tee <<-EOF 487 | 488 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 489 | 🚀 DEMO MODE IS NOW: $demo | PRESS [ENTER] to CONFIRM! 490 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 491 | EOF 492 | read -rp '' typed < /dev/tty 493 | optionsmenu 494 | 495 | } 496 | -------------------------------------------------------------------------------- /functions/createsdrive.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | csdrive () { 9 | pgclonevars 10 | 11 | tee <<-EOF 12 | 13 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14 | 🚀 Create a Shared Drive ~ oauth.pgblitz.com 15 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16 | 17 | https://accounts.google.com/o/oauth2/auth?client_id=$pgclonepublic&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=https://www.googleapis.com/auth/drive&response_type=code 18 | 19 | Copy & Paste the URL into Browser! Ensure to utilize and login with 20 | the correct Google Account! 21 | 22 | PUTTY USERS: Just select and highlight! DO NOT RIGHT CLICK! When you paste 23 | into the browser, it will just work! 24 | 25 | Quitting? Type >>> exit 26 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 27 | EOF 28 | read -p '↘️ Token | PRESS [ENTER]: ' token < /dev/tty 29 | if [[ "$token" == "exit" || "$token" == "Exit" || "$token" == "EXIT" ]]; then clonestart; fi 30 | curl --request POST --data "code=$token&client_id=$pgclonepublic&client_secret=$pgclonesecret&redirect_uri=urn:ietf:wg:oauth:2.0:oob&grant_type=authorization_code" https://accounts.google.com/o/oauth2/token > /pg/rclone/pgclone.info 31 | 32 | accesstoken=$(cat /pg/rclone/pgclone.info | grep access_token | awk '{print $2}') 33 | 34 | curl --request POST \ 35 | 'https://www.googleapis.com/drive/v3/teamdrives?requestId=foxfield' \ 36 | --header "Authorization: Bearer ${accesstoken}" \ 37 | --header 'Accept: application/json' \ 38 | --header 'Content-Type: application/json' \ 39 | --data '{"name":"pg-media","backgroundImageLink":"https://pgblitz.com/styles/io_dark/images/pgblitz4.png"}' \ 40 | --compressed 41 | } 42 | -------------------------------------------------------------------------------- /functions/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | deploysdrive () { 9 | deployblitzstartcheck # At Bottom - Ensure Keys Are Made 10 | 11 | # RCLONE BUILD 12 | echo "#------------------------------------------" > /pg/rclone/blitz.conf 13 | echo "#RClone Rewrite | Visit https://pgblitz.com" >> /pg/rclone/blitz.conf 14 | echo "#------------------------------------------" >> /pg/rclone/blitz.conf 15 | 16 | cat /pg/rclone/.gd >> /pg/rclone/blitz.conf 17 | 18 | if [[ $(cat "/pg/rclone/.gc") != "NOT-SET" ]]; then 19 | echo "" 20 | cat /pg/rclone/.gc >> /pg/rclone/blitz.conf; fi 21 | 22 | cat /pg/rclone/.sd >> /pg/rclone/blitz.conf 23 | 24 | if [[ $(cat "/pg/rclone/.sc") != "NOT-SET" ]]; then 25 | echo "" 26 | cat /pg/rclone/.sc >> /pg/rclone/blitz.conf; fi 27 | 28 | cat /pg/var/.keys >> /pg/rclone/blitz.conf 29 | 30 | deploydrives 31 | } 32 | 33 | deploygdrive () { 34 | # RCLONE BUILD 35 | echo "#------------------------------------------" > /pg/rclone/blitz.conf 36 | echo "#RClone Rewrite | Visit https://pgblitz.com" >> /pg/rclone/blitz.conf 37 | echo "#------------------------------------------" >> /pg/rclone/blitz.conf 38 | 39 | cat /pg/rclone/.gd > /pg/rclone/blitz.conf 40 | 41 | if [[ $(cat "/pg/rclone/.gc") != "NOT-SET" ]]; then 42 | echo "" 43 | cat /pg/rclone/.gc >> /pg/rclone/blitz.conf; fi 44 | deploydrives 45 | } 46 | 47 | deploydrives () { 48 | fail=0 49 | tee <<-EOF 50 | 51 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 52 | 🚀 Conducting RClone Mount Checks ~ pgclone.pgblitz.com 53 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 54 | 55 | EOF 56 | 57 | if [ -e "/pg/logs/.drivelog" ]; then rm -rf /pg/logs/.drivelog; fi 58 | touch /pg/logs/.drivelog 59 | 60 | if [[ "$transport" = "gd" ]]; then 61 | gdrivemod 62 | multihdreadonly 63 | elif [[ "$transport" == "gc" ]]; then 64 | gdrivemod 65 | gcryptmod 66 | multihdreadonly 67 | elif [[ "$transport" == "sd" ]]; then 68 | gdrivemod 69 | sdrivemod 70 | gdsamod 71 | multihdreadonly 72 | elif [[ "$transport" == "sc" ]]; then 73 | gdrivemod 74 | sdrivemod 75 | gdsamod 76 | gcryptmod 77 | scryptmod 78 | gdsacryptmod 79 | multihdreadonly 80 | fi 81 | 82 | cat /pg/logs/.drivelog 83 | logcheck=$(cat /pg/logs/.drivelog | grep "Failed") 84 | 85 | if [[ "$logcheck" == "" ]]; then 86 | if [[ "$transport" == "gd" || "$transport" == "gc" || "$transport" == "sd" || "$transport" == "sc" ]]; then executetransport; fi 87 | else 88 | if [[ "$transport" == "sd" || "$transport" == "sc" ]]; then 89 | emessage=" 90 | NOTE1: User forgot to share out GDSA E-Mail to Team Drive 91 | NOTE2: Conducted a blitz key restore and keys are no longer valid 92 | "; fi 93 | 94 | tee <<-EOF 95 | 96 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97 | 🚀 RClone Mount Checks - Failed 98 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 99 | 100 | CANNOT DEPLOY! 101 | 102 | POSSIBLE REASONS: 103 | 1. GSuite Account is no longer valid or suspended 104 | 2. Client ID and/or Secret are invalid and/or no longer exist 105 | $emessage 106 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 107 | EOF 108 | read -p '↘️ Acknowledge Info | Press [ENTER] ' typed2 < /dev/tty 109 | clonestart 110 | fi 111 | } 112 | 113 | ######################################################################################## 114 | gdrivemod () 115 | { 116 | initial=$(rclone lsd --config /pg/rclone/blitz.conf gd: | grep -oP plexguide | head -n1) 117 | 118 | if [[ "$initial" != "plexguide" ]]; then 119 | rclone mkdir --config /pg/rclone/blitz.conf gd:/plexguide 120 | initial=$(rclone lsd --config /pg/rclone/blitz.conf gd: | grep -oP plexguide | head -n1) 121 | fi 122 | 123 | if [[ "$initial" == "plexguide" ]]; then echo "GDRIVE : Passed" >> /pg/logs/.drivelog; else echo "GDRIVE : Failed" >> /pg/logs/.drivelog; fi 124 | } 125 | sdrivemod () 126 | { 127 | initial=$(rclone lsd --config /pg/rclone/blitz.conf sd: | grep -oP plexguide | head -n1) 128 | 129 | if [[ "tinitial" != "plexguide" ]]; then 130 | rclone mkdir --config /pg/rclone/blitz.conf gd:/plexguide 131 | initial=$(rclone lsd --config /pg/rclone/blitz.conf sd: | grep -oP plexguide | head -n1) 132 | fi 133 | 134 | if [[ "$initial" == "plexguide" ]]; then echo "SDRIVE : Passed" >> /pg/logs/.drivelog; else echo "SDRIVE : Failed" >> /pg/logs/.drivelog; fi 135 | } 136 | gcryptmod () 137 | { 138 | c1initial=$(rclone lsd --config /pg/rclone/blitz.conf gd: | grep -oP encrypt | head -n1) 139 | c2initial=$(rclone lsd --config /pg/rclone/blitz.conf gc: | grep -oP plexguide | head -n1) 140 | 141 | if [[ "$c1initial" != "encrypt" ]]; then 142 | rclone mkdir --config /pg/rclone/blitz.conf gd:/encrypt 143 | c1initial=$(rclone lsd --config /pg/rclone/blitz.conf gd: | grep -oP encrypt | head -n1) 144 | fi 145 | if [[ "$c2initial" != "plexguide" ]]; then 146 | rclone mkdir --config /pg/rclone/blitz.conf gc:/plexguide 147 | c2initial=$(rclone lsd --config /pg/rclone/blitz.conf gc: | grep -oP plexguide | head -n1) 148 | fi 149 | 150 | if [[ "$c1initial" == "encrypt" ]]; then echo "GCRYPT1: Passed" >> /pg/logs/.drivelog; else echo "GCRYPT1: Failed" >> /pg/logs/.drivelog; fi 151 | if [[ "$c2initial" == "plexguide" ]]; then echo "GCRYPT2: Passed" >> /pg/logs/.drivelog; else echo "GCRYPT2: Failed" >> /pg/logs/.drivelog; fi 152 | } 153 | scryptmod () 154 | { 155 | c1initial=$(rclone lsd --config /pg/rclone/blitz.conf sd: | grep -oP encrypt | head -n1) 156 | c2initial=$(rclone lsd --config /pg/rclone/blitz.conf sc: | grep -oP plexguide | head -n1) 157 | 158 | if [[ "$c1initial" != "encrypt" ]]; then 159 | rclone mkdir --config /pg/rclone/blitz.conf sd:/encrypt 160 | c1initial=$(rclone lsd --config /pg/rclone/blitz.conf sd: | grep -oP encrypt | head -n1) 161 | fi 162 | if [[ "$c2initial" != "plexguide" ]]; then 163 | rclone mkdir --config /pg/rclone/blitz.conf sc:/plexguide 164 | c2initial=$(rclone lsd --config /pg/rclone/blitz.conf sc: | grep -oP plexguide | head -n1) 165 | fi 166 | 167 | if [[ "$c1initial" == "encrypt" ]]; then echo "SCRYPT1: Passed" >> /pg/logs/.drivelog; else echo "SCRYPT1: Failed" >> /pg/logs/.drivelog; fi 168 | if [[ "$c2initial" == "plexguide" ]]; then echo "SCRYPT2: Passed" >> /pg/logs/.drivelog; else echo "SCRYPT2: Failed" >> /pg/logs/.drivelog; fi 169 | } 170 | gdsamod () 171 | { 172 | initial=$(rclone lsd --config /pg/rclone/blitz.conf GDSA01: | grep -oP plexguide | head -n1) 173 | 174 | if [[ "$initial" != "plexguide" ]]; then 175 | rclone mkdir --config /pg/rclone/blitz.conf GDSA01:/plexguide 176 | initial=$(rclone lsd --config /pg/rclone/blitz.conf GDSA01: | grep -oP plexguide | head -n1) 177 | fi 178 | 179 | if [[ "$initial" == "plexguide" ]]; then echo "GDSA01 : Passed" >> /pg/logs/.drivelog; else echo "GDSA01 : Failed" >> /pg/logs/.drivelog; fi 180 | } 181 | gdsacryptmod () 182 | { 183 | initial=$(rclone lsd --config /pg/rclone/blitz.conf GDSA01C: | grep -oP encrypt | head -n1) 184 | 185 | if [[ "$initial" != "plexguide" ]]; then 186 | rclone mkdir --config /pg/rclone/blitz.conf GDSA01C:/plexguide 187 | initial=$(rclone lsd --config /pg/rclone/blitz.conf GDSA01C: | grep -oP plexguide | head -n1) 188 | fi 189 | 190 | if [[ "$initial" == "plexguide" ]]; then echo "GDSA01C: Passed" >> /pg/logs/.drivelog; else echo "GDSA01C: Failed" >> /pg/logs/.drivelog; fi 191 | } 192 | ################################################################################ 193 | deployblitzstartcheck () { 194 | 195 | pgclonevars 196 | if [[ "$displaykey" == "0" ]]; then 197 | tee <<-EOF 198 | 199 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 200 | 🌎 Fail Notice ~ pgclone.pgblitz.com 201 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 202 | 203 | 💬 There are [0] keys generated for PG Blitz! Create those first! 204 | 205 | NOTE: Without any keys, PG Blitz cannot upload any data without the use 206 | of service accounts 207 | 208 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 209 | EOF 210 | 211 | read -p '↘️ Acknowledge Info | Press [ENTER] ' typed < /dev/tty 212 | clonestart 213 | fi 214 | } 215 | -------------------------------------------------------------------------------- /functions/deploylocal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | # NOTES 9 | # Variable recall comes from /functions/variables.sh 10 | ################################################################################ 11 | executelocal () { 12 | 13 | # Reset Front Display 14 | rm -rf plexguide/deployed.version 15 | 16 | # Call Variables 17 | pgclonevars 18 | 19 | # to remove all service running prior to ensure a clean launch 20 | ansible-playbook /pg/pgclone/ymls/remove.yml 21 | 22 | # builds multipath 23 | multihdreadonly 24 | 25 | # deploy union 26 | multihds=$(cat /pg/var/.tmp.multihd) 27 | ansible-playbook /pg/pgclone/ymls/local.yml -e "multihds=$multihds hdpath=$hdpath" 28 | 29 | # stores deployed version 30 | echo "le" > /pg/rclone/deployed.version 31 | 32 | # display edition final 33 | tee <<-EOF 34 | 35 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 36 | 💪 DEPLOYED: PG Local Edition 37 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 38 | EOF 39 | 40 | read -rp '↘️ Acknowledge Info | Press [ENTER] ' typed < /dev/tty 41 | 42 | } 43 | -------------------------------------------------------------------------------- /functions/deploysdrive.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | # NOTES 9 | # Variable recall comes from /functions/variables.sh 10 | ################################################################################ 11 | executeblitz () { 12 | 13 | # Reset Front Display 14 | rm -rf plexguide/deployed.version 15 | 16 | # Call Variables 17 | pgclonevars 18 | 19 | # to remove all service running prior to ensure a clean launch 20 | ansible-playbook /pg/pgclone/ymls/remove.yml 21 | 22 | # gdrive deploys by standard 23 | type=gd 24 | encryptbit="" 25 | ansible-playbook /pg/pgclone/ymls/mount.yml -e "\ 26 | bs=$bs 27 | dcs=$dcs 28 | dct=$dct 29 | cma=$cma 30 | rcs=$rcs 31 | rcsl=$rcsl 32 | drive=gd" 33 | 34 | type=sd 35 | ansible-playbook /pg/pgclone/ymls/mount.yml -e "\ 36 | bs=$bs 37 | dcs=$dcs 38 | dct=$dct 39 | cma=$cma 40 | rcs=$rcs 41 | rcsl=$rcsl 42 | cm="writes" 43 | drive=sd" 44 | 45 | # deploy only if gdrive is using encryption 46 | if [[ "$transport" == "sc" ]]; then 47 | type=gc 48 | ansible-playbook /pg/pgclone/ymls/crypt.yml -e "\ 49 | bs=$bs 50 | dcs=$dcs 51 | dct=$dct 52 | cma=$cma 53 | rcs=$rcs 54 | rcsl=$rcsl 55 | drive=gc" 56 | 57 | echo "sc" > /pg/rclone/deployed.version 58 | type=sc 59 | encryptbit="C" 60 | ansible-playbook /pg/pgclone/ymls/crypt.yml -e "\ 61 | bs=$bs 62 | dcs=$dcs 63 | dct=$dct 64 | cma=$cma 65 | rcs=$rcs 66 | rcsl=$rcsl 67 | drive=sc" 68 | fi 69 | 70 | # builds the list 71 | ls -la /pg/var/.blitzkeys/ | awk '{print $9}' | tail -n +4 | sort | uniq > /pg/var/.blitzlist 72 | rm -rf /pg/var/.blitzfinal 1>/dev/null 2>&1 73 | touch /pg/var/.blitzbuild 74 | while read p; do 75 | echo $p > /pg/var/.blitztemp 76 | blitzcheck=$(grep "GDSA" /pg/var/.blitztemp) 77 | if [[ "$blitzcheck" != "" ]]; then echo $p >> /pg/var/.blitzfinal; fi 78 | done /pg/rclone/deployed.version 24 | type=gd 25 | ansible-playbook /pg/pgclone/ymls/mount.yml -e "\ 26 | bs=$bs 27 | dcs=$dcs 28 | dct=$dct 29 | cma=$cma 30 | rcs=$rcs 31 | rcsl=$rcsl 32 | drive=gd" 33 | ########################################################### GDRIVE END 34 | 35 | ########################################################### SDRIVE END 36 | if [[ "$transport" == "gc" || "$transport" == "sc" || "$transport" == "sd" ]]; then 37 | type=sd 38 | echo "sd" > /pg/rclone/deployed.version 39 | encryptbit="" 40 | ansible-playbook /pg/pgclone/ymls/mount.yml -e "\ 41 | bs=$bs 42 | dcs=$dcs 43 | dct=$dct 44 | cma=$cma 45 | rcs=$rcs 46 | rcsl=$rcsl 47 | cm="writes" 48 | drive=sd" 49 | fi 50 | ########################################################### SDRIVE END 51 | 52 | ########################################################### ENCRYTPION START 53 | if [[ "$transport" == "gc" || "$transport" == "sc" ]]; then 54 | echo "gc" > /pg/rclone/deployed.version 55 | type=gc 56 | ansible-playbook /pg/pgclone/ymls/crypt.yml -e "\ 57 | bs=$bs 58 | dcs=$dcs 59 | dct=$dct 60 | cma=$cma 61 | rcs=$rcs 62 | rcsl=$rcsl 63 | drive=gc" 64 | fi 65 | 66 | if [[ "$transport" == "sc" ]]; then 67 | echo "sc" > /pg/rclone/deployed.version 68 | type=sc 69 | encryptbit="C" 70 | ansible-playbook /pg/pgclone/ymls/crypt.yml -e "\ 71 | bs=$bs 72 | dcs=$dcs 73 | dct=$dct 74 | cma=$cma 75 | rcs=$rcs 76 | rcsl=$rcsl 77 | drive=sc" 78 | fi 79 | ########################################################### ENCRYTPION END 80 | 81 | # builds the list 82 | if [[ "$transport" == "sd" || "$transport" == "sc" ]]; then 83 | ls -la /pg/var/.blitzkeys/ | awk '{print $9}' | tail -n +4 | sort | uniq > /pg/var/.blitzlist 84 | rm -rf /pg/var/.blitzfinal 1>/dev/null 2>&1 85 | touch /pg/var/.blitzbuild 86 | while read p; do 87 | echo $p > /pg/var/.blitztemp 88 | blitzcheck=$(grep "GDSA" /pg/var/.blitztemp) 89 | if [[ "$blitzcheck" != "" ]]; then echo $p >> /pg/var/.blitzfinal; fi 90 | done /dev/null 2>&1 11 | rm -rf /pg/var/.emaillist 1>/dev/null 2>&1 12 | 13 | ls -la /pg/var/.blitzkeys | awk '{print $9}' | tail -n +4 > /pg/var/.emailbuildlist 14 | while read p; do 15 | cat /pg/var/.blitzkeys/$p | grep client_email | awk '{print $2}' | sed 's/"//g' | sed 's/,//g' >> /pg/var/.emaillist 16 | done >> td.pgblitz.com 28 | 29 | NOTE 1: Share the E-Mails with the CORRECT TEAMDRIVE: $sdname 30 | NOTE 2: SAVE TIME! Copy & Paste the all the E-Mails into the share!" 31 | 32 | EOF 33 | cat /pg/var/.emaillist 34 | echo "" 35 | echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" 36 | read -rp '↘️ Completed? | Press [ENTER] ' typed < /dev/tty 37 | clonestart 38 | 39 | } 40 | -------------------------------------------------------------------------------- /functions/exclude: -------------------------------------------------------------------------------- 1 | qbittorrent 2 | rutorrent 3 | jd2-ovpn 4 | jdownloader2 5 | pyload 6 | rflood-openvpn 7 | rutorrent-openvpn 8 | transmission-vpn 9 | transmission-rss 10 | deluge 11 | -------------------------------------------------------------------------------- /functions/functions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | 9 | # BAD INPUT 10 | exitclone () { 11 | if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" ]]; then clonestart; fi 12 | } 13 | 14 | variable () { 15 | file="$1" 16 | if [ ! -e "$file" ]; then echo "$2" > $1; fi 17 | } 18 | 19 | mustset () { 20 | pgclonevars 21 | 22 | if [[ "$transport" == "NOT-SET" ]]; then 23 | tee <<-EOF 24 | 25 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 26 | 💪 Welcome to PG Clone ~ http://pgclone.pgblitz.com 27 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 28 | NOTE: PG Clone is a service that automates mergerfs; with mount, rclone, 29 | and key development to mount user drives and move/store data accordingly. 30 | Visit the link above before starting this process! 31 | 32 | [1] PG Clone Method: $transport 33 | [Z] Exit 34 | 35 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 36 | EOF 37 | 38 | read -rp '↘️ Input Selection | Press [ENTER]: ' typed < /dev/tty 39 | 40 | case $typed in 41 | 1 ) 42 | transportselect ;; 43 | z ) 44 | exit ;; 45 | Z ) 46 | exit ;; 47 | * ) 48 | mustset ;; 49 | esac 50 | fi 51 | } 52 | 53 | setthrottleblitz () { 54 | tee <<-EOF 55 | 56 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57 | 🚀 System Message: BW Limit Notice 📓 Reference: move.pgblitz.com 58 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 59 | 60 | 💬 100MB = 1 Gig Speeds | 1000MB = 10 Gig Speeds - Remember that your 61 | upload speeds are still limited to your server's max upload connection 62 | 63 | EOF 64 | read -rp '↘️ Type a Speed from 1 - 1000 | Press [ENTER]: ' typed < /dev/tty 65 | if [[ "$typed" -ge "1" && "$typed" -le "1000" ]]; then echo "$typed" > /pg/var/blitz.bw 66 | else setthrottleblitz; fi 67 | } 68 | 69 | setthrottlemove () { 70 | tee <<-EOF 71 | 72 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 73 | 🚀 System Message: BW Limit Notice 📓 Reference: move.pgblitz.com 74 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 75 | 76 | 💬 10MB is a safe limit. If exceeding 10MB and uploading straight for 77 | 24 hours, an upload ban will be triggered. 78 | 79 | EOF 80 | read -rp '↘️ Type a Speed from 1 - 1000 | Press [ENTER]: ' typed < /dev/tty 81 | if [[ "$typed" -ge "1" && "$typed" -le "1000" ]]; then echo "$typed" > /pg/var/move.bw 82 | else setthrottlemove; fi 83 | } 84 | 85 | rcpiece () { 86 | tee "/etc/fuse.conf" > /dev/null < /pg/rclone/gdrive.status && gdstatus="good"; 107 | else echo "bad" > /pg/rclone/gdrive.status && gdstatus="bad"; fi 108 | 109 | gccheck=$(cat /pg/rclone/blitz.conf | grep "remote = gd:/encrypt") 110 | if [ "$gccheck" != "" ]; then echo "good" > /pg/rclone/gcrypt.status && gcstatus="good"; 111 | else echo "bad" > /pg/rclone/gcrypt.status && gcstatus="bad"; fi 112 | 113 | tdcheck=$(cat /pg/rclone/blitz.conf | grep sdrive) 114 | if [ "$tdcheck" != "" ]; then echo "good" > /pg/rclone/sdrive.status && tdstatus="good" 115 | else echo "bad" > /pg/rclone/sdrive.status && tdstatus="bad"; fi 116 | 117 | } 118 | 119 | rcloneconfig () { 120 | rclone config --config /pg/rclone/blitz.conf 121 | } 122 | 123 | keysprocessed () { 124 | mkdir -p /pg/var/keys/processed 125 | ls -1 /pg/var/keys/processed | wc -l > /pg/var/project.keycount 126 | } 127 | 128 | deletemelateron () { 129 | pgclonevars 130 | 131 | tee <<-EOF 132 | 133 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 134 | 💪 PG Clone Key Management ~ http://pgclone.pgblitz.com 135 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 136 | 137 | [1] Google Account Login [$pgcloneemail] 138 | [2] Project Name [$pgcloneproject] 139 | [3] Build Service Keys [$displaykey] 140 | [4] E-Mail Generator 141 | 142 | [A] Keys Backup ~ NOT READY 143 | [B] Keys Restore ~ NOT READY 144 | [C] Keys Destroy 145 | [Z] Exit 146 | 147 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 148 | EOF 149 | 150 | read -rp '↘️ Input Selection | Press [ENTER]: ' typed < /dev/tty 151 | 152 | case $typed in 153 | 1 ) 154 | glogin ;; 155 | 2 ) 156 | projectname ;; 157 | 3 ) 158 | projectnamecheck 159 | keystart 160 | gdsaemail ;; 161 | 4 ) 162 | projectnamecheck 163 | deployblitzstartcheck 164 | emailgen ;; 165 | c ) 166 | deletekeys ;; 167 | C ) 168 | deletekeys ;; 169 | z ) 170 | clonestart ;; 171 | Z ) 172 | clonestart ;; 173 | * ) 174 | clonestart ;; 175 | esac 176 | clonestart 177 | } 178 | -------------------------------------------------------------------------------- /functions/gaccount.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | 9 | # BAD INPUT 10 | badinput () { 11 | echo 12 | read -p '⛔️ ERROR - Bad Input! | Press [ENTER] ' typed < /dev/tty 13 | } 14 | 15 | glogin () { 16 | 17 | emailaccount=$(cat /pg/var/project.email) 18 | 19 | tee <<-EOF 20 | 21 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 22 | 💪 Set E-Mail Address ~ http://pgclone.pgblitz.com 23 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 24 | What email address from the Google Console do you want to be associated 25 | with from your Google GSuite? Ensure that it exists! 26 | 27 | Quitting? Type >>> exit 28 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 29 | EOF 30 | 31 | read -p '↘️ Input E-Mail | Press [ENTER]: ' typed < /dev/tty 32 | 33 | if [[ "$typed" == "" ]]; then glogin; fi 34 | if [[ "$typed" == "Exit" || "$typed" == "exit" || "$typed" == "EXIT" ]]; then clonestart; fi 35 | 36 | gcloud auth login --account = $typed 37 | gcloud info | grep Account: | cut -c 10- > /pg/var/project.account 38 | account=$(cat /pg/var/project.account) 39 | 40 | testcheck=$(gcloud auth list | grep "$typed") 41 | if [[ "$testcheck" == "" ]]; then 42 | echo 43 | echo "INFO CHECK: E-Mail Address Failed!" 44 | read -p '↘️ Acknowledge Info | Press [ENTER] ' typed < /dev/tty 45 | glogin 46 | fi 47 | 48 | echo "$typed" > /pg/rclone/pgclone.email 49 | } 50 | -------------------------------------------------------------------------------- /functions/keyback.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | 9 | ### NOTE TO DELETE KEYS THAT EXIST WHEN BACKING UP 10 | keybackup () { 11 | 12 | serverid=$(cat /pg/var/pg.serverid) 13 | 14 | tee <<-EOF 15 | 16 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 17 | 🚀 System Message: Backing Up to GDrive - $serverid 18 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 19 | 20 | NOTE: Standby, takes a minute! 21 | 22 | EOF 23 | rclone purge --config /pg/rclone/blitz.conf gd:/plexguide/backup/keys/$serverid 24 | rclone copy --config /pg/rclone/blitz.conf /pg/rclone/blitz.conf gd:/plexguide/backup/keys/$serverid/conf -v --checksum --drive-chunk-size=64M 25 | rclone copy --config /pg/rclone/blitz.conf /pg/var/keys/processed/ gd:/plexguide/backup/keys/$serverid/keys -v --checksum --drive-chunk-size=64M 26 | 27 | tee <<-EOF 28 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 29 | 🚀 System Message: Backup Complete! 30 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 31 | 32 | EOF 33 | read -p '🌍 Acknowledge Info | Press [ENTER] ' typed2 < /dev/tty 34 | } 35 | 36 | keyrestore () { 37 | tee <<-EOF 38 | 39 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 40 | 🚀 Standby! Conducting Key Restore Check! 41 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42 | EOF 43 | rclone lsd --config /pg/rclone/blitz.conf gd:/plexguide/backup/keys/ | awk '{ print $5 }' > /tmp/service.keys 44 | checkcheck=$(cat /tmp/service.keys) 45 | 46 | if [ "$checkcheck" == "" ];then 47 | tee <<-EOF 48 | 49 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 50 | 🚀 Either You Failed to Configure RClone with GDrive or No Backups Exist! 51 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 52 | EOF 53 | read -p '🌍 Acknowledge Info | Press [ENTER] ' typed < /dev/tty 54 | keymenu 55 | fi 56 | 57 | tee <<-EOF 58 | 59 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60 | 🚀 Type the Name of the Backup to Restore 61 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62 | 63 | NOTE: Quit? Type > exit 64 | 65 | EOF 66 | cat /tmp/service.keys 67 | 68 | echo 69 | read -p '🌍 Type Name | Press [ENTER]: ' typed < /dev/tty 70 | 71 | if [ "$typed" == "exit" ]; then keymenu; fi 72 | 73 | grepcheck=$(cat /tmp/service.keys | grep $typed) 74 | if [ "$grepcheck" == "" ]; then 75 | tee <<-EOF 76 | 77 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78 | 🚀 Failed to Type Name of a Backup on the list! Restarting process! 79 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 80 | 81 | EOF 82 | read -p '🌍 Acknowledge Info | Press [ENTER] ' typed < /dev/tty 83 | keyrestore; fi 84 | 85 | serverid="$typed" 86 | mkdir -p /pg/var/processed 87 | 88 | tee <<-EOF 89 | 90 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 91 | 🚀 System Message: Restoring Keys - $serverid 92 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 93 | 94 | EOF 95 | rclone copy --config /pg/rclone/blitz.conf gd:/plexguide/backup/keys/$serverid/conf /pg/var/ -v --checksum --drive-chunk-size=64M 96 | rclone copy --config /pg/rclone/blitz.conf gd:/plexguide/backup/keys/$serverid/keys /pg/var/keys/processed/ -v --checksum --drive-chunk-size=64M 97 | 98 | tee <<-EOF 99 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100 | 🚀 System Message: Key Restoration Complete! 101 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 102 | 103 | NOTE: When conducting a restore, no need to share out emails and etc! Just 104 | redeploy PGBlitz! 105 | 106 | EOF 107 | read -p '🌍 Acknowledge Info | Press [ENTER] ' typed2 < /dev/tty 108 | keymenu 109 | } 110 | -------------------------------------------------------------------------------- /functions/keys.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Title: Reference Title File - PGBlitz 3 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors ~ Physik - FlickerRate 4 | # URL: https://pgblitz.com - http://github.pgblitz.com 5 | # GNU: General Public License v3.0 6 | ################################################################################ 7 | defaultvars () { 8 | touch /pg/var/rclone.gdrive 9 | touch /pg/var/rclone.gcrypt 10 | } 11 | 12 | # FOR START DEPLOYMENT END ##################################################### 13 | 14 | deploygcryptcheck () { 15 | type=gcrypt 16 | tee <<-EOF 17 | 18 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 19 | 🚀 System Message: Conducting Validation Checks - $type 20 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 21 | EOF 22 | sleep 1 23 | tee <<-EOF 24 | 25 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 26 | 🚀 System Message: Creating Test Directory - $type:/plexguide 27 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 28 | EOF 29 | sleep 1 30 | rclone mkdir --config /pg/rclone/blitz.conf $type:/plexguide 31 | tee <<-EOF 32 | 33 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 34 | 🚀 System Message: Checking Existance of $type:/plexguide 35 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 36 | 37 | EOF 38 | rcheck=$(rclone lsd --config /pg/rclone/blitz.conf $type: | grep -oP plexguide | head -n1) 39 | 40 | if [ "$rcheck" != "plexguide" ];then 41 | tee <<-EOF 42 | 43 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 44 | ⛔ System Message: Validation Checks Failed 45 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46 | 47 | TIPS: 48 | 1. Did you set up your gcrypt accordingly to the wiki? 49 | 2. Did you ensure that the gcrypt overlapped on gdrive per the wiki? 50 | 51 | EOF 52 | read -p '↘️ Acknowledge Info | Press [ENTER] ' typed2 < /dev/tty 53 | question1 54 | else 55 | tee <<-EOF 56 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57 | 🚀 System Message: Validation Checks Passed - $type 58 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 59 | 60 | EOF 61 | 62 | fi 63 | } 64 | 65 | deploygdrivecheck () { 66 | type=gdrive 67 | tee <<-EOF 68 | 69 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 70 | 🚀 System Message: Conducting Validation Checks - $type 71 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 72 | EOF 73 | sleep 1 74 | tee <<-EOF 75 | 76 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77 | 🚀 System Message: Creating Test Directory - $type:/plexguide 78 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 79 | EOF 80 | sleep 1 81 | rclone mkdir --config /pg/rclone/blitz.conf $type:/plexguide 82 | tee <<-EOF 83 | 84 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 85 | 🚀 System Message: Checking Existance of $type:/plexguide 86 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 87 | 88 | EOF 89 | rcheck=$(rclone lsd --config /pg/rclone/blitz.conf $type: | grep -oP plexguide | head -n1) 90 | 91 | if [ "$rcheck" != "plexguide" ];then 92 | tee <<-EOF 93 | 94 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 95 | ⛔ System Message: Validation Checks Failed 96 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97 | 98 | TIPS: 99 | 1. Did you set up your $type accordingly to the wiki? 100 | 101 | EOF 102 | read -p '↘️ Acknowledge Info | Press [ENTER] ' typed2 < /dev/tty 103 | question1 104 | else 105 | tee <<-EOF 106 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 107 | 🚀 System Message: Validation Checks Passed - $type 108 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 109 | EOF 110 | 111 | fi 112 | } 113 | 114 | deploysdrivecheck () { 115 | type=sdrive 116 | tee <<-EOF 117 | 118 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 119 | 🚀 System Message: Conducting Validation Checks - $type 120 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 121 | EOF 122 | sleep 1 123 | tee <<-EOF 124 | 125 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 126 | 🚀 System Message: Creating Test Directory - $type:/plexguide 127 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 128 | EOF 129 | sleep 1 130 | rclone mkdir --config /pg/rclone/blitz.conf $type:/plexguide 131 | tee <<-EOF 132 | 133 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 134 | 🚀 System Message: Checking Existance of $type:/plexguide 135 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 136 | 137 | EOF 138 | rcheck=$(rclone lsd --config /pg/rclone/blitz.conf $type: | grep -oP plexguide | head -n1) 139 | 140 | if [ "$rcheck" != "plexguide" ];then 141 | tee <<-EOF 142 | 143 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 144 | ⛔ System Message: Validation Checks Failed 145 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 146 | 147 | TIPS: 148 | 1. Did you set up your $type accordingly to the wiki? 149 | 150 | EOF 151 | read -p '↘️ Acknowledge Info | Press [ENTER] ' typed2 < /dev/tty 152 | question1 153 | else 154 | tee <<-EOF 155 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 156 | 🚀 System Message: Validation Checks Passed - $type 157 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 158 | EOF 159 | 160 | fi 161 | } 162 | 163 | deploygdsa01check () { 164 | type=gdsa01 165 | tee <<-EOF 166 | 167 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 168 | 🚀 System Message: Conducting Validation Checks - $type 169 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 170 | EOF 171 | sleep 1 172 | tee <<-EOF 173 | 174 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 175 | 🚀 System Message: Creating Test Directory - $type:/plexguide 176 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 177 | EOF 178 | sleep 1 179 | rclone mkdir --config /pg/rclone/blitz.conf $type:/plexguide 180 | tee <<-EOF 181 | 182 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 183 | 🚀 System Message: Checking Existance of $type:/plexguide 184 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 185 | 186 | EOF 187 | rcheck=$(rclone lsd --config /pg/rclone/blitz.conf $type: | grep -oP plexguide | head -n1) 188 | 189 | if [ "$rcheck" != "plexguide" ];then 190 | tee <<-EOF 191 | 192 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 193 | ⛔ System Message: Validation Checks Failed 194 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 195 | 196 | TIPS: 197 | 1. Did you set up your keys and share out your emails per the blitz wiki? 198 | 199 | EOF 200 | read -p '↘️ Acknowledge Info | Press [ENTER] ' typed2 < /dev/tty 201 | question1 202 | else 203 | tee <<-EOF 204 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 205 | 🚀 System Message: Validation Checks Passed - $type 206 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 207 | EOF 208 | 209 | fi 210 | } 211 | # FOR FINAL DEPLOYMENT END ##################################################### 212 | 213 | sdrivecheck () { 214 | type=sdrive 215 | tee <<-EOF 216 | 217 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 218 | 🚀 System Message: Conducting Validation Checks - $type 219 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 220 | EOF 221 | sleep 1 222 | tee <<-EOF 223 | 224 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 225 | 🚀 System Message: Creating Test Directory - $type:/plexguide 226 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 227 | EOF 228 | sleep 1 229 | rclone mkdir --config /pg/rclone/blitz.conf $type:/plexguide 230 | tee <<-EOF 231 | 232 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 233 | 🚀 System Message: Checking Existance of $type:/plexguide 234 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 235 | 236 | EOF 237 | rcheck=$(rclone lsd --config /pg/rclone/blitz.conf $type: | grep -oP plexguide | head -n1) 238 | 239 | if [ "$rcheck" != "plexguide" ];then 240 | tee <<-EOF 241 | 242 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 243 | ⛔ System Message: Validation Checks Failed 244 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 245 | 246 | TIPS: 247 | 1. Did you copy your username and password correctly? 248 | 2. When you created the credentials, did you select "Other"? 249 | 3. Did you enable your API? 250 | 251 | EOF 252 | echo "Not Active" > /pg/var/gd.pgclone 253 | read -p '↘️ Acknowledge Info | Press [ENTER] ' typed2 < /dev/tty 254 | question1 255 | else 256 | tee <<-EOF 257 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 258 | 🚀 System Message: Validation Checks Passed - $type 259 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 260 | EOF 261 | 262 | fi 263 | read -p '↘️ Acknowledge Info | Press [ENTER] ' typed2 < /dev/tty 264 | EOF 265 | } 266 | 267 | deletekeys2 () { 268 | choicedel=$(cat /pg/var/gdsa.cut) 269 | if [ "$choicedel" != "" ]; then 270 | echo "" 271 | echo "Deleting All Previous Service Accounts & Keys!" 272 | echo "" 273 | 274 | while read p; do 275 | gcloud iam service-accounts delete $p --quiet 276 | done /dev/null 2>&1 279 | tee <<-EOF 280 | 281 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 282 | 🚀 SYSTEM MESSAGE: Prior Service Accounts & Keys Deleted 283 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 284 | EOF 285 | sleep 2 286 | keymenu 287 | else 288 | tee <<-EOF 289 | 290 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 291 | 🚀 SYSTEM MESSAGE: No Prior Service Accounts or Keys! 292 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 293 | EOF 294 | sleep 2 295 | fi 296 | question1 297 | } 298 | 299 | deletekeys () { 300 | tee <<-EOF 301 | 302 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 303 | 🚀 ID: PG Key Gen Information 304 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 305 | 306 | EOF 307 | gcloud iam service-accounts list --filter="GDSA" > /pg/var/gdsa.list 308 | cat /pg/var/gdsa.list | awk '{print $2}' | tail -n +2 > /pg/var/gdsa.cut 309 | cat /pg/var/gdsa.cut 310 | tee <<-EOF 311 | 312 | Items listed are all service accounts that have been created! Proceeding 313 | onward will destroy all service accounts and current keys! 314 | 315 | EOF 316 | read -p '🌍 Proceed? y or n | Press [ENTER]: ' typed < /dev/tty 317 | 318 | if [[ "$typed" == "Y" || "$typed" == "y" ]]; then deletekeys2 319 | elif [[ "$typed" == "N" || "$typed" == "n" ]]; then question1 320 | else 321 | badinput 322 | deletekeys 323 | fi 324 | } 325 | 326 | gdsabuild () { 327 | 328 | ## what sets if encrypted is on or not 329 | encheck=$(cat /pg/rclone/pgclone.transport) 330 | bencrypted=no 331 | if [ "$encheck" == "sc" ]; then bencrypted=yes; fi 332 | 333 | downloadpath=$(cat /pg/var/server.hd.path) 334 | tempbuild=$(cat /pg/var/json.tempbuild) 335 | path=/pg/var/keys 336 | rpath=/pg/rclone/blitz.conf 337 | sdrive=$( cat /pg/rclone/blitz.conf | grep team_drive | head -n1 ) 338 | sdrive="${sd:13}" 339 | 340 | if [ "$bencrypted" == "yes" ]; then 341 | PASSWORD=$(cat /pg/rclone/pgclone.password) 342 | SALT=$(cat /pg/rclone/pgclone.salt) 343 | ENC_PASSWORD=`rclone obscure "$PASSWORD"` 344 | ENC_SALT=`rclone obscure "$SALT"`; fi 345 | 346 | ####tempbuild is need in order to call the correct gdsa 347 | mkdir -p $downloadpath/move/$tempbuild 348 | echo "" >> $rpath 349 | echo "[$tempbuild]" >> $rpath 350 | echo "type = drive" >> $rpath 351 | echo "client_id =" >> $rpath 352 | echo "client_secret =" >> $rpath 353 | echo "scope = drive" >> $rpath 354 | echo "root_folder_id =" >> $rpath 355 | echo "service_account_file = /pg/var/keys/processed/$tempbuild" >> $rpath 356 | echo "team_drive = $sdrive" >> $rpath 357 | 358 | if [ "$bencrypted" == "yes" ]; then 359 | echo "" >> $rpath 360 | echo "[${tempbuild}C]" >> $rpath 361 | echo "type = crypt" >> $rpath 362 | echo "remote = $tempbuild:/encrypt" >> $rpath 363 | echo "filename_encryption = standard" >> $rpath 364 | echo "directory_name_encryption = true" >> $rpath 365 | echo "password = $ENC_PASSWORD" >> $rpath 366 | echo "password2 = $ENC_SALT" >> $rpath; fi 367 | } 368 | 369 | deploykeys3 () { 370 | tee <<-EOF 371 | 372 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 373 | 🚀 SYSTEM MESSAGE: Key Number Selection! 374 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 375 | 376 | [1] Create 2 Keys: Daily Limit - 1.5 TB 377 | [2] Create 4 Keys: Daily Limit - 3.0 TB 378 | [3] Create 6 Keys: Daily Limit - 4.5 TB <--- Realistic 379 | [4] Create 8 Keys: Daily Limit - 6.0 TB 380 | [5] Create 10 Keys: Daily Limit - 7.5 TB 381 | [6] Create 20 Keys: Daily Limit - 15 TB <--- only GCE-FEEDER ! 382 | 383 | 💬 # of Keys Generated Sets Your Daily Upload Limit! 384 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 385 | EOF 386 | read -p '↘️ Type Choice | Press [ENTER]: ' typed < /dev/tty 387 | 388 | echo "" 389 | echo "NOTE: Please Wait" 390 | echo "" 391 | if [ "$typed" == "1" ]; then echo "Creating 2 Keys - Daily Upload Limit Set to 1.5TB" && keys=2; 392 | elif [ "$typed" == "2" ]; then echo "Creating 4 Keys - Daily Upload Limit Set to 3.0TB" && keys=4; 393 | elif [ "$typed" == "3" ]; then echo "Creating 6 Keys - Daily Upload Limit Set to 4.5TB" && keys=6; 394 | elif [ "$typed" == "4" ]; then echo "Creating 8 Keys - Daily Upload Limit Set to 6.0TB" && keys=8; 395 | elif [ "$typed" == "5" ]; then echo "Creating 10 Keys - Daily Upload Limit Set to 7.5TB" && keys=10; 396 | elif [ "$typed" == "6" ]; then echo "Creating 20 Keys - Daily Upload Limit Set to 15.0TB" && keys=20; 397 | fi 398 | sleep 2 399 | echo "" 400 | 401 | if [[ "$typed" -le "0" && "$typed" -ge 7 ]]; then deploykeys3; fi 402 | 403 | num=$keys 404 | count=0 405 | project=$(cat /pg/rclone/pgclone.project) 406 | 407 | ##wipe previous keys stuck there 408 | mkdir -p /pg/var/keys/processed/ 409 | rm -rf /pg/var/keys/processed/* 1>/dev/null 2>&1 410 | 411 | ## purpose of the rewrite is to save gdrive and sdrive info and toss old GDSAs 412 | cat /pg/rclone/blitz.conf | grep -w "\[sdrive\]" -A 5 > /pg/var/sdrive.info 413 | cat /pg/rclone/blitz.conf | grep -w "\[gdrive\]" -A 4 > /pg/var/gdrive.info 414 | cat /pg/rclone/blitz.conf | grep -w "\[scrypt\]" -A 6 > /pg/var/scrypt.info 415 | cat /pg/rclone/blitz.conf | grep -w "\[gcrypt\]" -A 6 > /pg/var/gcrypt.info 416 | 417 | echo "#### rclone rewrite generated by pgblitz.com" > /pg/rclone/blitz.conf 418 | echo "" >> /pg/rclone/blitz.conf 419 | echo "" >> /pg/rclone/blitz.conf 420 | cat /pg/var/gdrive.info >> /pg/rclone/blitz.conf 421 | echo "" >> /pg/rclone/blitz.conf 422 | cat /pg/var/sdrive.info >> /pg/rclone/blitz.conf 423 | echo "" >> /pg/rclone/blitz.conf 424 | cat /pg/var/scrypt.info >> /pg/rclone/blitz.conf 425 | echo "" >> /pg/rclone/blitz.conf 426 | cat /pg/var/gcrypt.info >> /pg/rclone/blitz.conf 427 | 428 | while [ "$count" != "$keys" ]; do 429 | ((count++)) 430 | rand=$(echo $((1 + RANDOM * RANDOM))) 431 | 432 | if [ "$count" -ge 1 -a "$count" -le 9 ]; then 433 | gcloud iam service-accounts create gdsa$rand --display-name “gdsa0$count” 434 | gcloud iam service-accounts keys create /pg/var/keys/processed/gdsa0$count --iam-account gdsa$rand@$project.iam.gserviceaccount.com --key-file-type="json" 435 | echo "gdsa0$count" > /pg/var/json.tempbuild 436 | gdsabuild 437 | echo "" 438 | else 439 | gcloud iam service-accounts create gdsa$rand --display-name “gdsa$count” 440 | gcloud iam service-accounts keys create /pg/var/keys/processed/gdsa$count --iam-account gdsa$rand@$project.iam.gserviceaccount.com --key-file-type="json" 441 | echo "gdsa$count" > /pg/var/json.tempbuild 442 | gdsabuild 443 | echo "" 444 | fi 445 | done 446 | 447 | echo "no" > /pg/var/project.deployed 448 | 449 | tee <<-EOF 450 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 451 | 🚀 SYSTEM MESSAGE: Key Generation Complete! 452 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 453 | 454 | 💬 Use the E-Mail Generator Next! Do Not Forget! 455 | 456 | EOF 457 | read -p '↘️ Acknowledge Info | Press [ENTER] ' typed < /dev/tty 458 | } 459 | 460 | deploykeys2 () { 461 | deploykeys3 462 | } 463 | 464 | deploykeys () { 465 | gcloud iam service-accounts list --filter="GDSA" > /pg/var/gdsa.list 466 | cat /pg/var/gdsa.list | awk '{print $2}' | tail -n +2 > /pg/var/gdsa.cut 467 | deploykeys2 468 | } 469 | 470 | projectid () { 471 | gcloud projects list > /pg/var/projects.list 472 | cat /pg/var/projects.list | cut -d' ' -f1 | tail -n +2 > /pg/var/project.cut 473 | projectlist=$(cat /pg/var/project.cut) 474 | tee <<-EOF 475 | 476 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 477 | 🚀 Projects Interface Menu 📓 Reference: project.pgblitz.com 478 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 479 | 480 | $projectlist 481 | 482 | EOF 483 | 484 | read -p '↘️ Type EXACT Project Name to Utilize | Press [ENTER]: ' typed2 < /dev/tty 485 | list=$(cat /pg/var/project.cut | grep $typed2) 486 | if [ "$list" == "" ]; then 487 | badinput && projectid; fi 488 | gcloud config set project $typed2 489 | tee <<-EOF 490 | 491 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 492 | 🚀 Standby - Enabling Your API 493 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 494 | 495 | EOF 496 | gcloud services enable drive.googleapis.com --project $typed2 497 | echo $typed2 > /pg/var/project.final 498 | echo 499 | read -p '🌍 Process Complete | Press [ENTER] ' typed2 < /dev/tty 500 | 501 | } 502 | 503 | ufsbuilder () { 504 | downloadpath=$(cat /pg/var/server.hd.path) 505 | ls -la /pg/var/keys/processed | awk '{ print $9}' | tail -n +4 > /tmp/pg.gdsa.ufs 506 | rm -rf /tmp/pg.gdsa.build 1>/dev/null 2>&1 507 | #echo -n "/pg/sd=RO:" > /tmp/pg.gdsa.build 508 | #echo -n "/pg/gd=RO:" >> /tmp/pg.gdsa.build 509 | ##### Encryption Portion ### Start 510 | #scrypt=$(grep "scrypt" /pg/rclone/blitz.conf) 511 | #gcrypt=$(grep "gcrypt" /pg/rclone/blitz.conf) 512 | 513 | #if [ "$scrypt" == "[scrypt]" ] && [ "$gcrypt" == "[gcrypt]" ]; then 514 | # encryption="on" 515 | # else 516 | encryption="off" 517 | #fi 518 | 519 | #if [ "$encryption" == "on" ]; then 520 | # echo -n "/pg/gc=RO:" >> /tmp/pg.gdsa.build 521 | #fi 522 | ##### Encryption Portion ### END 523 | file="/pg/var/unionfs.pgpath" 524 | if [ -e "$file" ]; then rm -rf /pg/var/unionfs.pgpath && touch /pg/var/unionfs.pgpath; fi 525 | 526 | while read p; do 527 | mkdir -p $downloadpath/move/$p 528 | echo -n "$downloadpath/move/$p=RO:" >> /pg/var/unionfs.pgpath 529 | done /pg/var/project.account 629 | account=$(cat /pg/var/project.account) 630 | project=$(cat /pg/rclone/pgclone.project) 631 | 632 | if [ "$account" == "NOT-SET" ]; then 633 | display5="[NOT-SET]" 634 | else 635 | display5="$account"; fi 636 | 637 | tee <<-EOF 638 | 639 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 640 | 🚀 PG Blitz Key Generation 📓 Reference: pgblitz.pgblitz.com 641 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 642 | 643 | [1] Google Account Login: $display5 644 | [2] Project Options : [$project] 645 | [3] Create Service Keys 646 | [4] EMail Generator 647 | [Z] Exit 648 | 649 | [A] Backup Keys 650 | [B] Restore Keys 651 | [C] Destory All Prior Service Accounts 652 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 653 | 654 | EOF 655 | 656 | read -p '↘️ Type Choice | Press [ENTER]: ' typed < /dev/tty 657 | 658 | if [ "$typed" == "1" ]; then 659 | gcloud auth login 660 | gcloud info | grep Account: | cut -c 10- > /pg/var/project.account 661 | account=$(cat /pg/var/project.account) 662 | keymenu 663 | elif [ "$typed" == "2" ]; then 664 | projectmenu 665 | keymenu 666 | elif [ "$typed" == "3" ]; then 667 | rchecker 668 | if [ $rchecker=fail ]; then 669 | deploykeys 670 | keymenu; fi 671 | elif [ "$typed" == "4" ]; then 672 | bash /pg/pgclone/emails.sh && echo 673 | read -p '↘️ Confirm Info | Press [ENTER]: ' typed < /dev/tty 674 | keymenu 675 | elif [[ "$typed" == "Z" || "$typed" == "z" ]]; then 676 | question1 677 | elif [[ "$typed" == "C" || "$typed" == "c" ]]; then 678 | deletekeys 679 | keymenu 680 | elif [[ "$typed" == "A" || "$typed" == "a" ]]; then 681 | keybackup 682 | keymenu 683 | elif [[ "$typed" == "B" || "$typed" == "b" ]]; then 684 | keyrestore 685 | keymenu 686 | else 687 | badinput 688 | keymenu; fi 689 | } 690 | -------------------------------------------------------------------------------- /functions/keysbuild.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | keystart () { 9 | pgclonevars 10 | 11 | tee <<-EOF 12 | 13 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14 | 🚀 Key Builder ~ http://pgclone.pgblitz.com 15 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16 | QUESTION - Create how many keys for PGBlitz? (From 2 thru 20 ) 17 | 18 | MATH: 19 | 2 Keys = 1.5 TB Daily | 6 Keys = 4.5 TB Daily 20 | 10 Keys = 7.5 TB Daily | 20 Keys = 15 TB Daily 21 | 22 | NOTE 1: Creating more keys DOES NOT SPEED up your transfers 23 | NOTE 2: Realistic key generation for most are 6 keys 24 | NOTE 3: Generating 100 keys over time, you must delete them all to create 25 | more, which is why making tons of keys is not ideal! 26 | 27 | Quitting? Type >>> exit 28 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 29 | EOF 30 | read -p '↘️ Type a Number [ 2 thru 20 ] | Press [ENTER]: ' typed < /dev/tty 31 | 32 | exitclone 33 | 34 | num=$typed 35 | if [[ "$typed" -le "0" || "$typed" -ge "51" ]]; then keystart 36 | elif [[ "$typed" -ge "1" && "$typed" -le "50" ]]; then keyphase2 37 | else keystart; fi 38 | } 39 | 40 | keyphase2 () { 41 | num=$typed 42 | 43 | rm -rf /pg/var/blitzkeys 1>/dev/null 2>&1 44 | mkdir -p /pg/var/blitzkeys 45 | 46 | cat /pg/rclone/.gd > /pg/rclone/blitz.conf 47 | if [ -e "/pg/rclone/.sd" ]; then cat /pg/rclone/.sd >> /pg/var/.keytemp; fi 48 | if [ -e "/pg/rclone/.gc" ]; then cat /pg/rclone/.gc >> /pg/var/.keytemp; fi 49 | if [ -e "/pg/rclone/.sc" ]; then cat /pg/rclone/.sc >> /pg/var/.keytemp; fi 50 | 51 | gcloud --account=${pgcloneemail} iam service-accounts list | awk '{print $1}' | \ 52 | tail -n +2 | cut -c2- | cut -f1 -d "?" | sort | uniq > /pg/var/.gcloudblitz 53 | 54 | rm -rf /pg/var/.blitzbuild 1>/dev/null 2>&1 55 | touch /pg/var/.blitzbuild 56 | while read p; do 57 | echo $p > /pg/var/.blitztemp 58 | blitzcheck=$(grep "blitz" /pg/var/.blitztemp) 59 | if [[ "$blitzcheck" != "" ]]; then echo $p >> /pg/var/.blitzbuild; fi 60 | done /dev/null 2>&1 71 | touch /pg/var/.keys 72 | rm -rf /pg/var/.blitzkeys 73 | mkdir -p /pg/var/.blitzkeys 74 | echo "" > /pg/var/.keys 75 | 76 | tee <<-EOF 77 | 78 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 79 | 🚀 Key Generator ~ [$num] keys 80 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 81 | EOF 82 | 83 | gdsacount () { 84 | ((gcount++)) 85 | if [[ "$gcount" -ge "1" && "$gcount" -le "9" ]]; then tempbuild=0${gcount} 86 | else tempbuild=$gcount; fi 87 | } 88 | 89 | keycreate1 () { 90 | #echo $count # for tshoot 91 | gdsacount 92 | gcloud --account=${pgcloneemail} iam service-accounts create blitz0${count} --display-name “blitz0${count}” 93 | gcloud --account=${pgcloneemail} iam service-accounts keys create /pg/var/.blitzkeys/GDSA${tempbuild} --iam-account blitz0${count}@${pgcloneproject}.iam.gserviceaccount.com --key-file-type="json" 94 | gdsabuild 95 | if [[ "$gcount" -ge "1" && "$gcount" -le "9" ]]; then echo "blitz0${count} is linked to GDSA${tempbuild}" 96 | else echo "blitz0${count} is linked to GDSA${gcount}"; fi 97 | echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" 98 | keysleft=$((keysleft-1)) 99 | flip=on 100 | } 101 | 102 | keycreate2 () { 103 | #echo $count # for tshoot 104 | gdsacount 105 | gcloud --account=${pgcloneemail} iam service-accounts create blitz${count} --display-name “blitz${count}” 106 | gcloud --account=${pgcloneemail} iam service-accounts keys create /pg/var/.blitzkeys/GDSA${tempbuild} --iam-account blitz${count}@${pgcloneproject}.iam.gserviceaccount.com --key-file-type="json" 107 | gdsabuild 108 | if [[ "$gcount" -ge "1" && "$gcount" -le "9" ]]; then echo "blitz${count} is linked to GDSA${tempbuild}" 109 | else echo "blitz${count} is linked to GDSA${gcount}"; fi 110 | echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" 111 | keysleft=$((keysleft-1)) 112 | flip=on 113 | } 114 | 115 | keysmade=0 116 | while [[ "$keysleft" -gt "0" ]]; do 117 | flip=off 118 | while [[ "$flip" == "off" ]]; do 119 | ((count++)) 120 | if [[ "$count" -ge "1" && "$count" -le "9" ]]; then 121 | if [[ $(grep "0${count}" /pg/var/.blitzbuild) = "" ]]; then keycreate1; fi 122 | else 123 | if [[ $(grep "${count}" /pg/var/.blitzbuild) = "" ]]; then keycreate2; fi; fi 124 | done 125 | done 126 | 127 | } 128 | 129 | gdsabuild () { 130 | pgclonevars 131 | ####tempbuild is need in order to call the correct gdsa 132 | tee >> /pg/var/.keys <<-EOF 133 | [GDSA${tempbuild}] 134 | type = drive 135 | scope = drive 136 | service_account_file = /pg/var/.blitzkeys/GDSA${tempbuild} 137 | team_drive = ${sdid} 138 | 139 | EOF 140 | 141 | if [[ "$transport" == "sc" || "$transport" == "sd" ]]; then 142 | encpassword=$(rclone obscure "${clonepassword}") 143 | encsalt=$(rclone obscure "${clonesalt}") 144 | 145 | tee >> /pg/var/.keys <<-EOF 146 | [GDSA${tempbuild}C] 147 | type = crypt 148 | remote = GDSA${tempbuild}:/encrypt 149 | filename_encryption = standard 150 | directory_name_encryption = true 151 | password = $encpassword 152 | password2 = $encsalt 153 | 154 | EOF 155 | 156 | fi 157 | #echo "" /pg/var/.keys 158 | } 159 | 160 | gdsaemail () { 161 | tee <<-EOF 162 | EOF 163 | 164 | read -rp '↘️ Process Complete! Ready to Share E-Mails? | Press [ENTER] ' typed < /dev/tty 165 | emailgen 166 | } 167 | 168 | deletekeys () { 169 | pgclonevars 170 | gcloud --account=${pgcloneemail} iam service-accounts list > /pg/var/.deletelistpart1 171 | 172 | if [[ $(cat /pg/var/.deletelistpart1) == "" ]]; then 173 | 174 | tee <<-EOF 175 | 176 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 177 | 🚀 Error! Nothing To Delete! 178 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 179 | 180 | NOTE: No Accounts for Project ~ $pgcloneproject 181 | are detected! Exiting! 182 | 183 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 184 | EOF 185 | read -p '↘️ Acknowledge Info! | PRESS [ENTER] ' token < /dev/tty 186 | clonestart; fi 187 | 188 | rm -rf /pg/var/.listpart2 1>/dev/null 2>&1 189 | while read p; do 190 | echo $p > /pg/var/.listpart1 191 | writelist=$(grep pg-bumpnono-143619 /pg/var/.listpart1) 192 | if [[ "$writelist" != "" ]]; then echo $writelist >> /pg/var/.listpart2; fi 193 | done /pg/var/.gcloudblitz 197 | 198 | tee <<-EOF 199 | 200 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 201 | 🚀 Keys to Delete? 202 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 203 | 204 | EOF 205 | cat /pg/var/.gcloudblitz 206 | tee <<-EOF 207 | 208 | Delete All Keys for Project ~ ${pgcloneproject}? 209 | 210 | WARNING: If Plex, Emby, and/or JellyFin are using these keys, stop the 211 | containers! Deleting keys in use by this project will result in those 212 | containers losing metadata (due to being unable to access teamdrives)! 213 | 214 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 215 | EOF 216 | 217 | read -p '↘️ Type y or n | PRESS [ENTER]: ' typed < /dev/tty 218 | case $typed in 219 | y ) 220 | yesdeletekeys ;; 221 | Y ) 222 | yesdeletekeys ;; 223 | N ) 224 | clonestart ;; 225 | n ) 226 | clonestart ;; 227 | * ) 228 | deletekeys ;; 229 | esac 230 | } 231 | 232 | yesdeletekeys () { 233 | rm -rf /pg/var/.blitzkeys/* 1>/dev/null 2>&1 234 | echo "" 235 | while read p; do 236 | gcloud --account=${pgcloneemail} iam service-accounts delete $p --quiet 237 | done Press CTRL + X, Select "YES", and PRESS 27 | [ENTER] to save the settings! Do not change the name of the file! 28 | 29 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 30 | EOF 31 | 32 | read -rp '↘️ PRESS [ENTER] to CONTINUE! ' fluffycat < /dev/tty 33 | 34 | nano /pg/rclone/pgclone.json 35 | 36 | } 37 | -------------------------------------------------------------------------------- /functions/multihd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | multihdreadonly () { 9 | 10 | # calls up standard variables 11 | pgclonevars 12 | 13 | # removes the temporary variable when starting 14 | rm -rf /pg/var/.tmp.multihd 1>/dev/null 2>&1 15 | 16 | # reads the list of paths 17 | while read p; do 18 | 19 | # prevents copying blanks areas 20 | if [[ "$p" != "" ]]; then 21 | echo -n "$p=NC:" >> /pg/var/.tmp.multihd 22 | chown -R 1000:1000 "$p" 23 | chmod -R 755 "$p" 24 | fi 25 | 26 | done >> exit 26 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 27 | EOF 28 | read -p '↘️ Token | PRESS [ENTER]: ' token < /dev/tty 29 | if [[ "$token" == "exit" || "$token" == "Exit" || "$token" == "EXIT" ]]; then clonestart; fi 30 | curl --request POST --data "code=$token&client_id=$pgclonepublic&client_secret=$pgclonesecret&redirect_uri=urn:ietf:wg:oauth:2.0:oob&grant_type=authorization_code" https://accounts.google.com/o/oauth2/token > /pg/rclone/pgclone.info 31 | 32 | accesstoken=$(cat /pg/rclone/pgclone.info | grep access_token | awk '{print $2}') 33 | refreshtoken=$(cat /pg/rclone/pgclone.info | grep refresh_token | awk '{print $2}') 34 | rcdate=$(date +'%Y-%m-%d') 35 | rctime=$(date +"%H:%M:%S" --date="$givenDate 60 minutes") 36 | rczone=$(date +"%:z") 37 | final=$(echo "${rcdate}T${rctime}${rczone}") 38 | 39 | ######################## 40 | rm -rf /pg/rclone/.${type} 1>/dev/null 2>&1 41 | echo "" > /pg/rclone/.${type} 42 | echo "[$type]" >> /pg/rclone/.${type} 43 | echo "client_id = $pgclonepublic" >> /pg/rclone/.${type} 44 | echo "client_secret = $pgclonesecret" >> /pg/rclone/.${type} 45 | echo "type = drive" >> /pg/rclone/.${type} 46 | echo -n "token = {\"access_token\":${accesstoken}\"token_type\":\"Bearer\",\"refresh_token\":${refreshtoken}\"expiry\":\"${final}\"}" >> /pg/rclone/.${type} 47 | echo "" >> /pg/rclone/.${type} 48 | if [ "$type" == "sd" ]; then 49 | teamid=$(cat /pg/rclone/pgclone.teamid) 50 | echo "team_drive = $teamid" >> /pg/rclone/.sd; fi 51 | echo "" 52 | 53 | echo ${type} > /pg/rclone/oauth.check 54 | oauthcheck 55 | 56 | ## Adds Encryption to the Test Phase if Move or Blitz Encrypted is On 57 | if [[ "$transport" == "sd" || "$transport" == "gc" ]]; then 58 | 59 | if [ "$type" == "gd" ]; then entype="gc"; 60 | else entype="sc"; fi 61 | 62 | PASSWORD=`cat /pg/rclone/pgclone.password` 63 | SALT=`cat /pg/rclone/pgclone.salt` 64 | ENC_PASSWORD=`rclone obscure "$PASSWORD"` 65 | ENC_SALT=`rclone obscure "$SALT"` 66 | 67 | rm -rf /pg/rclone/.${entype} 1>/dev/null 2>&1 68 | echo "" >> /pg/rclone/.${entype} 69 | echo "[$entype]" >> /pg/rclone/.${entype} 70 | echo "type = crypt" >> /pg/rclone/.${entype} 71 | echo "remote = $type:/encrypt" >> /pg/rclone/.${entype} 72 | echo "filename_encryption = standard" >> /pg/rclone/.${entype} 73 | echo "directory_name_encryption = true" >> /pg/rclone/.${entype} 74 | echo "password = $ENC_PASSWORD" >> /pg/rclone/.${entype} 75 | echo "password2 = $ENC_SALT" >> /pg/rclone/.${entype}; 76 | fi 77 | 78 | tee <<-EOF 79 | 80 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 81 | 🌎 Process Complete ~ pgclone.pgblitz.com 82 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 83 | 84 | 💬 [${type}] is now established! 85 | 86 | NOTE: If you change projects or use a different login, rerun this again! 87 | If not, nothing will work! 88 | 89 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 90 | EOF 91 | read -p '↘️ Acknowledge Info | Press [ENTER] ' typed < /dev/tty 92 | clonestart 93 | 94 | } 95 | # (BELOW - SET TEAMDRIVE NAME)################################################## 96 | tlabeloauth () { 97 | pgclonevars 98 | gtype="https://www.googleapis.com/drive/v3/teamdrives" 99 | storage="/pg/rclone/teamdrive.output" 100 | 101 | tee <<-EOF 102 | 103 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 104 | 🚀 Google Auth - Team Drive Label ~ oauth.pgblitz.com 105 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 106 | 107 | https://accounts.google.com/o/oauth2/auth?client_id=${pgclonepublic}&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=https://www.googleapis.com/auth/drive&response_type=code 108 | 109 | Copy & Paste the URL into Browser! Ensure to utilize and login with 110 | the correct Google Account! 111 | 112 | PUTTY USERS: Just select and highlight! DO NOT RIGHT CLICK! When you paste 113 | into the browser, it will just work! 114 | 115 | Quitting? Type >>> exit 116 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 117 | EOF 118 | read -p '↘️ Token | PRESS [ENTER]: ' token < /dev/tty 119 | 120 | if [[ "$token" = "exit" || "$token" == "Exit" || "$token" == "EXIT" ]]; then clonestart; fi 121 | curl --request POST --data "code=${token}&client_id=${pgclonepublic}&client_secret=${pgclonesecret}&redirect_uri=urn:ietf:wg:oauth:2.0:oob&grant_type=authorization_code" https://accounts.google.com/o/oauth2/token > /pg/var/token.part1 122 | curl -H "GData-Version: 3.0" -H "Authorization: Bearer $(cat /pg/var/token.part1 | grep access_token | awk '{ print $2 }' | cut -c2- | rev | cut -c3- | rev)" $gtype > $storage 123 | 124 | teamdriveselect 125 | } 126 | 127 | teamdriveselect () { 128 | cat /pg/rclone/teamdrive.output | grep "id" | awk '{ print $2 }' | cut -c2- | rev | cut -c3- | rev > /pg/rclone/teamdrive.id 129 | cat /pg/rclone/teamdrive.output | grep "name" | awk '{ print $2 }' | cut -c2- | rev | cut -c2- | rev > /pg/rclone/teamdrive.name 130 | 131 | tee <<-EOF 132 | 133 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 134 | 🚀 Listed Team Drives 135 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 136 | 137 | EOF 138 | A=0 139 | while read p; do 140 | ((A++)) 141 | name=$(sed -n ${A}p /pg/rclone/teamdrive.name) 142 | echo "[$A] $p - $name" 143 | done /pg/rclone/pgclone.teamdrive 172 | echo "$id" > /pg/rclone/pgclone.teamid 173 | 174 | tee <<-EOF 175 | 176 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 177 | 🚀 Process Complete! TeamDrive [$name] 178 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 179 | 180 | NOTE: Do not share out your teamdrives to others! The usage counts against 181 | you and if others share your content, you have no control (and your team 182 | drive can be shutdown!) 183 | 184 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 185 | EOF 186 | read -p '↘️ Acknowledge Info | PRESS [ENTER] ' temp < /dev/tty 187 | } 188 | 189 | mountchecker () { 190 | pgclonevars 191 | if [[ "$transport" == "gd" ]]; then 192 | if [[ "$gdstatus" != "ACTIVE" ]]; then mountfail; fi 193 | elif [[ "$transport" == "gc" ]]; then 194 | if [[ "$gdstatus" != "ACTIVE" || "$gcstatus" != "ACTIVE" ]]; then mountfail; fi 195 | elif [[ "$transport" == "sd" ]]; then 196 | if [[ "$gdstatus" != "ACTIVE" || "$sdstatus" != "ACTIVE" ]]; then mountfail; fi 197 | elif [[ "$transport" == "sd" ]]; then 198 | if [[ "$gdstatus" != "ACTIVE" || "$sdstatus" != "ACTIVE" || "$sdstatus" != "ACTIVE" || "$scstatus" != "ACTIVE" ]]; then mountfail; fi 199 | fi 200 | } 201 | 202 | mountfail () { 203 | tee <<-EOF 204 | 205 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 206 | 🌎 Fail Notice ~ pgclone.pgblitz.com 207 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 208 | 209 | 💬 All Mounts Must Be Active! 210 | 211 | NOTE: If any mount says [NOT-SET]; that process must be completed first! 212 | We will continue to block this process until completed! 213 | 214 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 215 | EOF 216 | read -p '↘️ Acknowledge Info | Press [ENTER] ' typed < /dev/tty 217 | clonestart 218 | } 219 | 220 | tlabelchecker () { 221 | pgclonevars 222 | if [[ "$sdname" == "NOT-SET" ]]; then 223 | 224 | tee <<-EOF 225 | 226 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 227 | 🌎 Fail Notice ~ oauth.pgblitz.com 228 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 229 | 230 | 💬 Team Drive Label Not Set! 231 | 232 | NOTE: Unless we know your Team Drive name, we have no way of configuring 233 | the Team Drive! Please complete this first! 234 | 235 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 236 | EOF 237 | read -p '↘️ Acknowledge Info | Press [ENTER] ' typed < /dev/tty 238 | clonestart 239 | fi 240 | } 241 | -------------------------------------------------------------------------------- /functions/oauthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | oauthcheck () { 9 | pgclonevars 10 | 11 | tee <<-EOF 12 | 13 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14 | 🚀 Conducting Validation Checks: $oauthcheck 15 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16 | 17 | EOF 18 | rcheck=$(rclone lsd --config /pg/rclone/.$oauthcheck $oauthcheck: | grep -oP plexguide | head -n1) 19 | if [[ "$rcheck" != "plexguide" ]]; then 20 | rclone mkdir --config /pg/rclone/.$oauthcheck $oauthcheck:/plexguide 21 | rcheck=$(rclone lsd --config /pg/rclone/.$oauthcheck $oauthcheck: | grep -oP plexguide | head -n1) 22 | fi 23 | 24 | if [ "$rcheck" != "plexguide" ]; then 25 | tee <<-EOF 26 | 27 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 28 | ⛔ Validation Checks Failed: $oauthcheck 29 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 30 | 31 | NOTES: 32 | 1. Did you set up your $oauthcheck accordingly to the wiki? 33 | 2. Is your project active? 34 | 35 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 36 | EOF 37 | rm -rf /pg/rclone/.$oauthcheck 1>/dev/null 2>&1 38 | 39 | if [[ "$oauthcheck" == "gdrive" ]]; then rm -rf /pg/rclone/.gd 1>/dev/null 2>&1; fi 40 | if [[ "$oauthcheck" == "sdrive" ]]; then rm -rf /pg/rclone/.sd 1>/dev/null 2>&1; fi 41 | 42 | read -p '↘️ Acknowledge Info | Press [ENTER] ' typed2 < /dev/tty 43 | clonestart 44 | else 45 | tee <<-EOF 46 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 47 | 🚀 System Message: Validation Checks Passed - $oauthcheck 48 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 49 | EOF 50 | fi 51 | } 52 | -------------------------------------------------------------------------------- /functions/passwords.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | blitzpasswordmain () { 9 | pgclonevars 10 | 11 | clonepassword57=$(cat /pg/rclone/pgclone.password) 12 | clonesalt57=$(cat /pg/rclone/pgclone.salt) 13 | 14 | if [[ "$pstatus" != "NOT-SET" ]]; then 15 | tee <<-EOF 16 | 17 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18 | 🚀 PG Clone - Change Values? ~ pgclone.pgblitz.com 19 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 20 | 21 | Password (Primary) 22 | $clonepassword57 23 | 24 | Password (SALT/Secondary) 25 | $clonesalt57 26 | 27 | Change the Stored Values? 28 | [1] No [2] Yes 29 | 30 | WARNING: Changing the values will RESET & DELETE the following: 31 | 1. GDrive 32 | 2. SDrive 33 | 3. Service Keys 34 | 35 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 36 | EOF 37 | read -p '↘️ Input Value | Press [Enter]: ' typed < /dev/tty 38 | case $typed in 39 | 2 ) 40 | rm -rf /pg/rclone/pgclone.password 1>/dev/null 2>&1 41 | rm -rf /pg/rclone/pgclone.salt 1>/dev/null 2>&1 42 | 43 | rm -rf /pg/rclone/.gc 1>/dev/null 2>&1 44 | rm -rf /pg/rclone/.gd 1>/dev/null 2>&1 45 | rm -rf /pg/rclone/.sc 1>/dev/null 2>&1 46 | rm -rf /pg/rclone/.sd 1>/dev/null 2>&1 47 | rm -rf /pg/rclone/pgclone.teamdrive 1>/dev/null 2>&1 48 | ;; 49 | 1 ) 50 | clonestart ;; 51 | * ) 52 | blitzpasswordmain ;; 53 | esac 54 | fi 55 | 56 | tee <<-EOF 57 | 58 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 59 | 🌎 Primary Password ~ pgclone.pgblitz.com 60 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61 | Set a Primary Password for data encryption! DO NOT forget the password! 62 | If you do, we are UNABLE to recover all of your DATA! That is the primary 63 | risk of encryption; forgetfulness will cost you! 64 | 65 | Quitting? Type >>> exit 66 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 67 | EOF 68 | read -p '↘️ Type Main Password | Press [ENTER]: ' typed < /dev/tty 69 | 70 | if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" ]]; then clonestart; fi 71 | if [[ "$typed" == "" ]]; then blitzpasswordmain; fi 72 | primarypassword=$typed 73 | blitzpasswordsalt 74 | } 75 | 76 | blitzpasswordsalt () { 77 | tee <<-EOF 78 | 79 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 80 | 🌎 SALT (SALT Password) ~ pgclone.pgblitz.com 81 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 82 | NOTE: We do not recommended using the same password! SALT adds randomness 83 | to your original password. 84 | 85 | Set a SALT password for data encryption! DO NOT forget the password! 86 | If you do, we are UNABLE to recover all of your DATA! That is the primary 87 | risk of encryption; forgetfulness will cost you! 88 | 89 | Quitting? Type >>> exit 90 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 91 | EOF 92 | read -p '↘️ Type SALT Password | Press [ENTER]: ' typed < /dev/tty 93 | 94 | if [[ "$typed" == "exit" || "$typed" == "Exit" || "$typed" == "EXIT" ]]; then clonestart; fi 95 | if [[ "$typed" == "" ]]; then blitzpasswordsalt; fi 96 | 97 | secondarypassword=$typed 98 | blitzpasswordfinal 99 | 100 | } 101 | 102 | blitzpasswordfinal () { 103 | tee <<-EOF 104 | 105 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 106 | 🌎 Set Passwords ~ pgclone.pgblitz.com 107 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 108 | Set the Following Passwords? Type y or n! 109 | 110 | Primary: $primarypassword 111 | SALT : $secondarypassword 112 | 113 | Quitting? Type >>> exit 114 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 115 | EOF 116 | 117 | read -p '↘️ Type y or n | Press [ENTER]: ' typed < /dev/tty 118 | 119 | if [[ "$typed" == "n" ]]; then blitzpasswordmain; 120 | elif [[ "$typed" == "y" ]]; then 121 | echo $primarypassword > /pg/rclone/pgclone.password 122 | echo $secondarypassword > /pg/rclone/pgclone.salt 123 | else blitzpasswordfinal; fi 124 | 125 | tee <<-EOF 126 | 127 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 128 | 🌎 Process Complete ~ pgclone.pgblitz.com 129 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 130 | 131 | 💬 Password & SALT are now SET! Do not forget the data! 132 | 133 | NOTE: If you set this up again, ensure to reuse the same passwords in 134 | order to read the data! 135 | 136 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 137 | EOF 138 | read -p '↘️ Acknowledge Info | Press [ENTER] ' typed < /dev/tty 139 | clonestart 140 | } 141 | 142 | passwordcheck () { 143 | pgclonevars 144 | 145 | if [[ "$pstatus" == "NOT-SET" ]]; then 146 | 147 | tee <<-EOF 148 | 149 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 150 | 🌎 Password Notice ~ pgclone.pgblitz.com 151 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 152 | 153 | 💬 Utilizing Encryption requires setting passwords first! 154 | 155 | NOTE: When setting the passwords, they act as a private key in order 156 | to encrypt your data! 157 | 158 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 159 | EOF 160 | read -p '↘️ Acknowledge Info | Press [ENTER] ' typed < /dev/tty 161 | clonestart; fi 162 | } 163 | -------------------------------------------------------------------------------- /functions/pgclone.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | bandwidth () { 9 | tee <<-EOF 10 | 11 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12 | 🚀 System Message: BW Limit Notice 📓 Reference: move.pgblitz.com 13 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14 | 15 | 💬 10MB is a safe limit. If exceeding 10MB and uploading straight for 16 | 24 hours, an upload ban will be triggered. 17 | 18 | EOF 19 | read -p '↘️ Type a Speed from 1 - 1000 | Press [ENTER]: ' typed < /dev/tty 20 | if [[ "$typed" -ge "1" && "$typed" -le "1000" ]]; then echo "$typed" > /pg/var/move.bw && question1; 21 | else badinput && bandwidth; fi 22 | } 23 | 24 | bandwidthblitz () { 25 | tee <<-EOF 26 | 27 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 28 | 🚀 System Message: BW Limit Notice 📓 Reference: move.pgblitz.com 29 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 30 | 31 | 💬 100MB = 1 Gig Speeds | 1000MB = 10 Gig Speeds - Remember that your 32 | upload speeds are still limited to your server's max upload connection 33 | 34 | EOF 35 | read -p '↘️ Type a Speed from 1 - 1000 | Press [ENTER]: ' typed < /dev/tty 36 | if [[ "$typed" -ge "1" && "$typed" -le "1000" ]]; then echo "$typed" > /pg/var/blitz.bw && question1; 37 | else badinput && bandwidth; fi 38 | } 39 | 40 | statusmount () { 41 | mcheck5=$(cat /pg/rclone/blitz.conf | grep "$type") 42 | if [ "$mcheck5" != "" ]; then 43 | tee <<-EOF 44 | 45 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46 | ⚠️ System Message: Warning! 47 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48 | NOTE: $type already exists! To proceed, we must delete the prior 49 | configuration for you. 50 | 51 | EOF 52 | read -p '↘️ Proceed? y or n | Press [ENTER]: ' typed < /dev/tty 53 | 54 | if [[ "$typed" == "Y" || "$typed" == "y" ]]; then a=b 55 | elif [[ "$typed" == "N" || "$typed" == "n" ]]; then mountsmenu 56 | else 57 | badinput 58 | statusmount 59 | fi 60 | 61 | rclone config delete $type --config /pg/rclone/blitz.conf 62 | 63 | encheck=$(cat /pg/rclone/pgclone.transport) 64 | if [[ "$encheck" == "sc" || "$encheck" == "gc" ]]; then 65 | if [ "$type" == "gc" ]; then 66 | rclone config delete gcrypt --config /pg/rclone/blitz.conf; fi 67 | if [ "$type" == "sd" ]; then 68 | rclone config delete scrypt --config /pg/rclone/blitz.conf; fi 69 | fi 70 | 71 | tee <<-EOF 72 | 73 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 74 | 🚀 System Message: $type deleted! 75 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 76 | 77 | EOF 78 | read -p '↘️ Acknowledge Info | Press [ENTER] ' typed < /dev/tty 79 | fi 80 | } 81 | 82 | tmgen() { 83 | 84 | secret=$(cat /pg/rclone/pgclone.secret) 85 | public=$(cat /pg/rclone/pgclone.public) 86 | 87 | tee <<-EOF 88 | 89 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 90 | 🚀 Google Auth - Shared Drives | 📓 Reference: oauth.pgblitz.com 91 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 92 | Quitting? Type > exit 93 | NOTE: Copy & Paste Url into Browser | Use Correct Google Account! 94 | 95 | https://accounts.google.com/o/oauth2/auth?client_id=$public&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=https://www.googleapis.com/auth/drive&response_type=code 96 | 97 | EOF 98 | read -p '↘️ Token | PRESS [ENTER]: ' token < /dev/tty 99 | if [ "$token" = "exit" ]; then mountsmenu; fi 100 | curl --request POST --data "code=$token&client_id=$public&client_secret=$secret&redirect_uri=urn:ietf:wg:oauth:2.0:oob&grant_type=authorization_code" https://accounts.google.com/o/oauth2/token > /pg/var/pgtokentm.output 101 | cat /pg/var/pgtokentm.output | grep access_token | awk '{ print $2 }' | cut -c2- | rev | cut -c3- | rev > /pg/var/pgtokentm2.output 102 | primet=$(cat /pg/var/pgtokentm2.output) 103 | curl -H "GData-Version: 3.0" -H "Authorization: Bearer $primet" https://www.googleapis.com/drive/v3/teamdrives > /pg/rclone/teamdrive.output 104 | tokenscript 105 | 106 | name=$(sed -n ${typed}p /pg/rclone/teamdrive.name) 107 | id=$(sed -n ${typed}p /pg/rclone/teamdrive.id) 108 | echo "$name" > /pg/rclone/pgclone.teamdrive 109 | echo "$id" > /pg/rclone/pgclone.teamid 110 | tee <<-EOF 111 | 112 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 113 | 😂 What a Lame Shared Drive Name: $name 114 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 115 | 116 | EOF 117 | read -p '↘️ Acknowledge Info | PRESS [ENTER] ' temp < /dev/tty 118 | } 119 | 120 | tokenscript () { 121 | cat /pg/rclone/teamdrive.output | grep "id" | awk '{ print $2 }' | cut -c2- | rev | cut -c3- | rev > /pg/rclone/teamdrive.id 122 | cat /pg/rclone/teamdrive.output | grep "name" | awk '{ print $2 }' | cut -c2- | rev | cut -c2- | rev > /pg/rclone/teamdrive.name 123 | 124 | tee <<-EOF 125 | 126 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 127 | 🚀 Listed Team Drives 128 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 129 | 130 | EOF 131 | A=0 132 | while read p; do 133 | ((A++)) 134 | name=$(sed -n ${A}p /pg/rclone/teamdrive.name) 135 | echo "[$A] $p - $name" 136 | done exit 186 | NOTE: Copy & Paste Url into Browser | Use Correct Google Account! 187 | 188 | https://accounts.google.com/o/oauth2/auth?client_id=$public&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=https://www.googleapis.com/auth/drive&response_type=code 189 | 190 | EOF 191 | read -p '↘️ Token | PRESS [ENTER]: ' token < /dev/tty 192 | if [ "$token" = "exit" ]; then mountsmenu; fi 193 | curl --request POST --data "code=$token&client_id=$public&client_secret=$secret&redirect_uri=urn:ietf:wg:oauth:2.0:oob&grant_type=authorization_code" https://accounts.google.com/o/oauth2/token > /pg/rclone/pgclone.info 194 | 195 | accesstoken=$(cat /pg/rclone/pgclone.info | grep access_token | awk '{print $2}') 196 | refreshtoken=$(cat /pg/rclone/pgclone.info | grep refresh_token | awk '{print $2}') 197 | rcdate=$(date +'%Y-%m-%d') 198 | rctime=$(date +"%H:%M:%S" --date="$givenDate 60 minutes") 199 | rczone=$(date +"%:z") 200 | final=$(echo "${rcdate}T${rctime}${rczone}") 201 | 202 | testphase 203 | } 204 | 205 | mountsmenu () { 206 | 207 | # Sets Display Status if Passwords are not set for the encryhpted edition 208 | check5=$(cat /pg/rclone/pgclone.password) 209 | check6=$(cat /pg/rclone/pgclone.salt) 210 | if [[ "$check5" == "" || "$check6" == "" ]]; then passdisplay="⚠️ Not Activated" 211 | else passdisplay="✅ Activated"; fi 212 | 213 | projectid=$(cat /pg/rclone/pgclone.project) 214 | secret=$(cat /pg/rclone/pgclone.secret) 215 | public=$(cat /pg/rclone/pgclone.public) 216 | teamdrive=$(cat /pg/rclone/pgclone.teamdrive) 217 | 218 | if [ "$secret" == "" ]; then dsecret="NOT SET"; else dsecret="SET"; fi 219 | if [ "$public" == "" ]; then dpublic="NOT SET"; else dpublic="SET"; fi 220 | if [ "$teamdrive" == "" ]; then dteamdrive="NOT SET"; else dteamdrive=$teamdrive; fi 221 | 222 | gdstatus=$(cat /pg/var/gd.pgclone) 223 | sdstatus=$(cat /pg/var/sd.pgclone) 224 | 225 | ###### START 226 | if [ "$transport" == "PG Move /w No Encryption" ]; then 227 | tee <<-EOF 228 | 229 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 230 | 🌎 PG Clone - OAuth & Mounts 📓 Reference: pgclone.pgblitz.com 231 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 232 | 233 | 💾 OAuth 234 | [1] Client ID: $dpublic 235 | [2] Secret ID: ${dsecret} 236 | 237 | 📁 RClone Configuration 238 | [3] gdrive : $gdstatus 239 | [Z] Exit 240 | 241 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 242 | EOF 243 | 244 | read -p '↘️ Set Choice | Press [ENTER]: ' typed < /dev/tty 245 | 246 | if [ "$typed" == "1" ]; then 247 | publickeyinput 248 | mountsmenu 249 | elif [ "$typed" == "2" ]; then 250 | secretkeyinput 251 | mountsmenu 252 | elif [ "$typed" == "3" ]; then 253 | type=gdrive 254 | statusmount 255 | inputphase 256 | mountsmenu 257 | elif [[ "$typed" == "Z" || "$typed" == "z" ]]; then question1; 258 | else badinput 259 | mountsmenu; fi 260 | fi 261 | ########## END 262 | 263 | ########## START 264 | if [ "$transport" == "PG Move /w Encryption" ]; then 265 | tee <<-EOF 266 | 267 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 268 | 🌎 PG Clone - OAuth & Mounts 📓 Reference: pgclone.pgblitz.com 269 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 270 | 271 | 💾 OAuth 272 | [1] Client ID: $dpublic 273 | [2] Secret ID: ${dsecret} 274 | 275 | 💡 Required Tasks 276 | [3] Passwords: $passdisplay 277 | 278 | 📁 RClone Configuration 279 | [4] gdrive : $gdstatus 280 | [Z] Exit 281 | 282 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 283 | EOF 284 | 285 | read -p '↘️ Set Choice | Press [ENTER]: ' typed < /dev/tty 286 | 287 | if [ "$typed" == "1" ]; then 288 | publickeyinput 289 | mountsmenu 290 | elif [ "$typed" == "2" ]; then 291 | secretkeyinput 292 | mountsmenu 293 | elif [ "$typed" == "3" ]; then 294 | blitzpasswords 295 | mountsmenu 296 | elif [ "$typed" == "4" ]; then 297 | encpasswdcheck 298 | type=gdrive 299 | statusmount 300 | inputphase 301 | mountsmenu 302 | elif [[ "$typed" == "Z" || "$typed" == "z" ]]; then question1; 303 | else badinput 304 | mountsmenu; fi 305 | fi 306 | ###### END 307 | 308 | ###### START 309 | if [ "$transport" == "PG Blitz /w No Encryption" ]; then 310 | tee <<-EOF 311 | 312 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 313 | 🌎 PG Clone - OAuth & Mounts 📓 Reference: pgclone.pgblitz.com 314 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 315 | 316 | 💾 OAuth 317 | [1] Client ID: $dpublic 318 | [2] Secret ID: ${dsecret} 319 | 320 | 💡 Required Tasks 321 | [3] TD Label : $dteamdrive 322 | 323 | 📁 RClone Configuration 324 | [4] gdrive : $gdstatus 325 | [5] sdrive : $sdstatus 326 | [Z] Exit 327 | 328 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 329 | EOF 330 | 331 | read -p '↘️ Set Choice | Press [ENTER]: ' typed < /dev/tty 332 | 333 | if [ "$typed" == "1" ]; then 334 | publickeyinput 335 | mountsmenu 336 | elif [ "$typed" == "2" ]; then 337 | secretkeyinput 338 | mountsmenu 339 | elif [ "$typed" == "3" ]; then 340 | tmgen 341 | mountsmenu 342 | elif [ "$typed" == "4" ]; then 343 | type=gdrive 344 | statusmount 345 | inputphase 346 | mountsmenu 347 | elif [ "$typed" == "5" ]; then 348 | tmcheck=$(cat /pg/rclone/pgclone.teamdrive) 349 | if [ "$tmcheck" == "" ]; then 350 | tee <<-EOF 351 | 352 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 353 | ⛔ Warning! TeamDrive is blank! Must be Set Prior! 354 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 355 | 356 | EOF 357 | read -p '↘️ Acknowledge Info | Press [ENTER] ' typed < /dev/tty 358 | mountsmenu; fi 359 | type=sdrive 360 | statusmount 361 | inputphase 362 | mountsmenu 363 | elif [[ "$typed" == "Z" || "$typed" == "z" ]]; then question1; 364 | else badinput 365 | mountsmenu; fi 366 | fi 367 | #################### END 368 | 369 | ##### START 370 | if [ "$transport" == "PG Blitz /w Encryption" ]; then 371 | tee <<-EOF 372 | 373 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 374 | 🌎 PG Clone - OAuth & Mounts 📓 Reference: pgclone.pgblitz.com 375 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 376 | 377 | 💾 OAuth 378 | [1] Client ID: $dpublic 379 | [2] Secret ID: ${dsecret} 380 | 381 | 💡 Required Tasks 382 | [3] TD Label : $dteamdrive 383 | [4] Passwords: $passdisplay 384 | 385 | 📁 RClone Configuration 386 | [5] gdrive : $gdstatus 387 | [6] sdrive : $sdstatus 388 | [Z] Exit 389 | 390 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 391 | EOF 392 | 393 | read -p '↘️ Set Choice | Press [ENTER]: ' typed < /dev/tty 394 | 395 | if [ "$typed" == "1" ]; then 396 | publickeyinput 397 | mountsmenu 398 | elif [ "$typed" == "2" ]; then 399 | secretkeyinput 400 | mountsmenu 401 | elif [ "$typed" == "3" ]; then 402 | tmgen 403 | mountsmenu 404 | elif [ "$typed" == "4" ]; then 405 | blitzpasswords 406 | mountsmenu 407 | elif [ "$typed" == "5" ]; then 408 | encpasswdcheck 409 | type=gdrive 410 | statusmount 411 | inputphase 412 | mountsmenu 413 | elif [ "$typed" == "6" ]; then 414 | encpasswdcheck 415 | tmcheck=$(cat /pg/rclone/pgclone.teamdrive) 416 | if [ "$tmcheck" == "" ]; then 417 | tee <<-EOF 418 | 419 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 420 | ⛔ Warning! TeamDrive is blank! Must be Set Prior! 421 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 422 | 423 | EOF 424 | read -p '↘️ Acknowledge Info | Press [ENTER] ' typed < /dev/tty 425 | mountsmenu; fi 426 | type=sdrive 427 | statusmount 428 | inputphase 429 | mountsmenu 430 | elif [[ "$typed" == "Z" || "$typed" == "z" ]]; then question1; 431 | else badinput 432 | mountsmenu; fi 433 | fi 434 | #################### END 435 | 436 | } 437 | 438 | encpasswdcheck () { 439 | check5=$(cat /pg/rclone/pgclone.password) 440 | check6=$(cat /pg/rclone/pgclone.salt) 441 | 442 | if [[ "$check5" == "" || "$check6" == "" ]]; then 443 | tee <<-EOF 444 | 445 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 446 | ⛔ Warning! You Need to Setup Your Passwords for the Encrypted Edition 447 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 448 | 449 | EOF 450 | read -p '↘️ Acknowledge Info | Press [ENTER] ' typed < /dev/tty 451 | mountsmenu; fi 452 | } 453 | 454 | blitzpasswords () { 455 | tee <<-EOF 456 | 457 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 458 | 🌎 Primary Password 📓 Reference: pgclone.pgblitz.com 459 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 460 | Quitting? Type > Exit 461 | 462 | Please set a Primary Password for Encryption! Do not forget it! If you do, 463 | you will be locked out from all your data! 464 | 465 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 466 | EOF 467 | read -p ' ↘️ Type Prime PW | Press [ENTER]: ' bpassword < /dev/tty 468 | 469 | if [ "$bpassword" == "" ]; then 470 | badinput 471 | blitzpasswords 472 | elif [ "$bpassword" == "exit" ]; then mountsmenu; fi 473 | blitzsalt 474 | } 475 | 476 | blitzsalt () { 477 | tee <<-EOF 478 | 479 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 480 | 🌎 SALT (Secondary Password) 📓 Reference: pgclone.pgblitz.com 481 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 482 | Quitting? Type > Exit 483 | 484 | Please set a Secondary Password (SALT) for Encryption! Do not forget it! 485 | If you do, you will be locked out from all your data! SALT randomizes 486 | your data to further protect you! It is not recommended to use the same 487 | password, but may. 488 | 489 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 490 | EOF 491 | read -p ' ↘️ Type SALT PW | Press [ENTER]: ' bsalt < /dev/tty 492 | 493 | if [ "$bsalt" == "" ]; then 494 | badinput 495 | blitzsalt 496 | elif [ "$bsalt" == "exit" ]; then mountsmenu; fi 497 | blitzpfinal 498 | 499 | } 500 | 501 | blitzpfinal () { 502 | tee <<-EOF 503 | 504 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 505 | 🌎 Set Passwords? 📓 Reference: pgclone.pgblitz.com 506 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 507 | Quitting? Type > Exit 508 | 509 | Are you happy with the following info? Type y or n! 510 | 511 | Primary : $bpassword 512 | Secondary: $bsalt 513 | 514 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 515 | EOF 516 | 517 | read -p '↘️ Type y or n | Press [ENTER]: ' typed < /dev/tty 518 | 519 | if [ "$typed" == "n" ]; then mountsmenu; 520 | elif [ "$typed" == "y" ]; then 521 | echo $bpassword > /pg/rclone/pgclone.password 522 | echo $bsalt > /pg/rclone/pgclone.salt 523 | mountsmenu; 524 | else 525 | badinput 526 | blitzpfinal; fi 527 | } 528 | 529 | publickeyinput () { 530 | tee <<-EOF 531 | 532 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 533 | 🚀 Google OAuth Keys - Client ID 📓 Reference: oauth.pgblitz.com 534 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 535 | Quitting? Type > exit 536 | NOTE: Visit reference for Google OAuth Keys! 537 | 538 | EOF 539 | 540 | read -p '↘️ Client ID | Press [Enter]: ' public < /dev/tty 541 | if [ "$public" = "exit" ]; then mountsmenu; fi 542 | echo "$public" > /pg/rclone/pgclone.public 543 | 544 | tee <<-EOF 545 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 546 | 🌎 Client ID Set 📓 Reference: pgclone.pgblitz.com 547 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 548 | 549 | EOF 550 | read -p '↘️ Acknowledge Info | Press [ENTER] ' public < /dev/tty 551 | mountsmenu 552 | } 553 | 554 | secretkeyinput () { 555 | tee <<-EOF 556 | 557 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 558 | 🚀 Google OAuth Keys - Secret Key 📓 Reference: oauth.pgblitz.com 559 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 560 | Quitting? Type > exit 561 | NOTE: Visit reference for Google OAuth Keys! 562 | 563 | EOF 564 | read -p '↘️ Secret Key | Press [Enter]: ' secret < /dev/tty 565 | if [ "$secret" = "exit" ]; then mountsmenu; fi 566 | echo "$secret" > /pg/rclone/pgclone.secret 567 | 568 | tee <<-EOF 569 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 570 | 🌎 Secret ID Set 📓 Reference: pgclone.pgblitz.com 571 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 572 | 573 | EOF 574 | read -p '↘️ Acknowledge Info | Press [ENTER] ' public < /dev/tty 575 | 576 | mountsmenu 577 | } 578 | 579 | projectmenu () { 580 | projectid=$(cat /pg/rclone/pgclone.project) 581 | 582 | tee <<-EOF 583 | 584 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 585 | 🌎 GCloud Project Interface 📓 Reference: pgclone.pgblitz.com 586 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 587 | Project ID: $projectid 588 | 589 | [1] Establish 590 | [2] Create 591 | [3] Destroy (NOT READY) 592 | [Z] Exit 593 | 594 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 595 | EOF 596 | 597 | read -p '↘️ Set Choice | Press [ENTER]: ' typed < /dev/tty 598 | 599 | if [ "$typed" == "1" ]; then projectestablish; 600 | elif [ "$typed" == "2" ]; then projectcreate; 601 | elif [[ "$typed" == "z" || "$typed" == "Z" ]]; then question1; 602 | else badinput 603 | projectmenu; fi 604 | } 605 | 606 | projectestablish () { 607 | 608 | gcloud projects list > /pg/var/projects.list 609 | projectcheck=(cat /pg/var/projects.list) 610 | if [ "$projectcheck" == "" ]; then 611 | tee <<-EOF 612 | 613 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 614 | ⛔ System Message: Error! There are no projects! Make one first! 615 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 616 | 617 | EOF 618 | read -p ' ↘️ Acknowledge Info | Press [ENTER] ' typed < /dev/tty 619 | projectmenu 620 | fi 621 | 622 | 623 | tee <<-EOF 624 | 625 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 626 | 🌎 Established Projects 📓 Reference: pgclone.pgblitz.com 627 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 628 | Project ID: $projectid 629 | 630 | EOF 631 | cat /pg/var/projects.list | cut -d' ' -f1 | tail -n +2 632 | cat /pg/var/projects.list | cut -d' ' -f1 | tail -n +2 > /pg/var/project.cut 633 | echo 634 | changeproject 635 | echo 636 | projectidset 637 | gcloud config set project $typed 638 | 639 | tee <<-EOF 640 | 641 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 642 | 🌎 System Message: Enabling Drive API ~ Project $typed 643 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 644 | EOF 645 | gcloud services enable drive.googleapis.com --project $typed 646 | tee <<-EOF 647 | 648 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 649 | 🌎 System Message: Project Established ~ $typed 650 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 651 | 652 | EOF 653 | echo $typed > /pg/rclone/pgclone.project 654 | read -p '↘️ Acknowledge Info | Press [ENTER] ' typed < /dev/tty 655 | projectmenu 656 | 657 | } 658 | 659 | transportdisplay () { 660 | temp=$(cat /pg/rclone/pgclone.transport) 661 | if [ "$temp" == "gd" ]; then transport="GDrive Unencrypted" 662 | elif [ "$temp" == "gc" ]; then transport="GDrive Encrypted" 663 | elif [ "$temp" == "sd" ]; then transport="SDrive Unencrypted" 664 | elif [ "$temp" == "sc" ]; then transport="SDrive Encrypted" 665 | elif [ "$temp" == "solohd" ]; then transport="PG Local" 666 | else transport="NOT-SET"; fi 667 | } 668 | 669 | transportmode () { 670 | tee <<-EOF 671 | 672 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 673 | 🌟 Select Transport Mode 📓 Reference: transport.pgblitz.com 674 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 675 | 676 | [1] GDrive Unencrypted | Upload 750GB Daily ~ Simple 677 | [2] GDrive Encrypted | Upload 750GB Daily ~ Simple 678 | [3] SDrive Unencrypted | Exceed 750GB Daily ~ Complex 679 | [4] SDrive Encrypted | Exceed 750GB Daily ~ Complex 680 | [5] PG Local | No GSuite - Stays Local 681 | [Z] Exit 682 | 683 | EOF 684 | read -p '↘️ Set Choice | Press [ENTER]: ' typed < /dev/tty 685 | 686 | if [ "$typed" == "1" ]; then echo "gd" > /pg/rclone/pgclone.transport && echo; 687 | elif [ "$typed" == "2" ]; then echo "gc" > /pg/rclone/pgclone.transport && echo; 688 | elif [ "$typed" == "3" ]; then echo "sd" > /pg/rclone/pgclone.transport && echo; 689 | elif [ "$typed" == "4" ]; then echo "sc" > /pg/rclone/pgclone.transport && echo; 690 | elif [ "$typed" == "5" ]; then echo "solohd" > /pg/rclone/pgclone.transport && echo; 691 | elif [[ "$typed" == "Z" || "$typed" == "z" ]]; then 692 | 693 | # If a New Installer, User Cannot Exit & Must Select a Version 694 | transport=$(cat /pg/rclone/pgclone.transport) 695 | if [ "$transport" == "NOT-SET" ]; then 696 | transportmode; fi 697 | 698 | question1; 699 | else 700 | badinput 701 | transportmode; fi 702 | } 703 | 704 | changeproject () { 705 | read -p '💬 Set/Change Project ID? (y/n)| Press [ENTER] ' typed < /dev/tty 706 | if [[ "$typed" == "n" || "$typed" == "N" ]]; then question1 707 | elif [[ "$typed" == "y" || "$typed" == "Y" ]]; then a=b 708 | else badinput 709 | echo "" 710 | changeproject; fi 711 | } 712 | 713 | projectidset () { 714 | tee <<-EOF 715 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 716 | 🚀 System Message: Type the Project Name to Utilize 717 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 718 | 719 | EOF 720 | cat /pg/var/projects.list | cut -d' ' -f1 | tail -n +2 721 | cat /pg/var/projects.list | cut -d' ' -f1 | tail -n +2 > /pg/var/project.cut 722 | echo "" 723 | read -p '↘️ Type Project Name | Press [ENTER]: ' typed < /dev/tty 724 | echo "" 725 | list=$(cat /pg/var/project.cut | grep $typed) 726 | 727 | if [ "$typed" != "$list" ]; then 728 | tee <<-EOF 729 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 730 | ⛔ System Message: Error! Type Exact of the Project Name Listed! 731 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 732 | 733 | EOF 734 | read -p ' ↘️ Acknowledge Info | Press [ENTER] ' typed < /dev/tty 735 | projectidset 736 | fi 737 | } 738 | 739 | testphase () { 740 | echo "" > /pg/rclone/test.conf 741 | echo "[$type]" >> /pg/rclone/test.conf 742 | echo "client_id = $public" >> /pg/rclone/test.conf 743 | echo "client_secret = $secret" >> /pg/rclone/test.conf 744 | echo "type = drive" >> /pg/rclone/test.conf 745 | echo -n "token = {\"access_token\":${accesstoken}\"token_type\":\"Bearer\",\"refresh_token\":${refreshtoken}\"expiry\":\"${final}\"}" >> /pg/rclone/test.conf 746 | echo "" >> /pg/rclone/test.conf 747 | if [ "$type" == "sd" ]; then 748 | teamid=$(cat /pg/rclone/pgclone.teamid) 749 | echo "team_drive = $teamid" >> /pg/rclone/test.conf; fi 750 | echo "" 751 | 752 | ## Adds Encryption to the Test Phase if Move or Blitz Encrypted is On 753 | encheck=$(cat /pg/rclone/pgclone.transport) 754 | if [[ "$encheck" == "sc" || "$encheck" == "gc" ]]; then 755 | 756 | if [ "$type" == "gdrive" ]; then entype="gcrypt"; 757 | else entype="scrypt"; fi 758 | 759 | PASSWORD=`cat /pg/rclone/pgclone.password` 760 | SALT=`cat /pg/rclone/pgclone.salt` 761 | ENC_PASSWORD=`rclone obscure "$PASSWORD"` 762 | ENC_SALT=`rclone obscure "$SALT"` 763 | echo "" >> /pg/rclone/test.conf 764 | echo "[$entype]" >> /pg/rclone/test.conf 765 | echo "type = crypt" >> /pg/rclone/test.conf 766 | echo "remote = $type:/encrypt" >> /pg/rclone/test.conf 767 | echo "filename_encryption = standard" >> /pg/rclone/test.conf 768 | echo "directory_name_encryption = true" >> /pg/rclone/test.conf 769 | echo "password = $ENC_PASSWORD" >> /pg/rclone/test.conf 770 | echo "password2 = $ENC_SALT" >> /pg/rclone/test.conf; 771 | 772 | fi 773 | testphase2 774 | } 775 | 776 | testphase2 () { 777 | tee <<-EOF 778 | 779 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 780 | 🚀 System Message: Conducting Validation Checks - $type 781 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 782 | EOF 783 | sleep 1 784 | tee <<-EOF 785 | 786 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 787 | 🚀 System Message: Creating Test Directory - $type:/plexguide 788 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 789 | EOF 790 | sleep 1 791 | rclone mkdir --config /pg/rclone/test.conf $type:/plexguide 792 | tee <<-EOF 793 | 794 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 795 | 🚀 System Message: Checking Existance of $type:/plexguide 796 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 797 | 798 | EOF 799 | rcheck=$(rclone lsd --config /pg/rclone/test.conf $type: | grep -oP plexguide | head -n1) 800 | 801 | if [ "$rcheck" != "plexguide" ];then 802 | tee <<-EOF 803 | 804 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 805 | ⛔ System Message: Validation Checks Failed 806 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 807 | 808 | TIPS: 809 | 1. Did you copy your username and password correctly? 810 | 2. When you created the credentials, did you select "Other"? 811 | 3. Did you enable your API? 812 | 813 | FOR ENCRYPTION (IF SELECTED) 814 | 1. Did You Set a Password? 815 | 816 | EOF 817 | echo "⚠️ Not Activated" > /pg/var/$type.pgclone 818 | read -p '↘️ Acknowledge Info | Press [ENTER] ' typed2 < /dev/tty 819 | question1 820 | else 821 | tee <<-EOF 822 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 823 | 🚀 System Message: Validation Checks Passed - $type 824 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 825 | 826 | EOF 827 | 828 | fi 829 | 830 | read -p '↘️ Acknowledge Info | Press [ENTER] ' typed2 < /dev/tty 831 | echo "✅ Activated" > /pg/var/$type.pgclone 832 | 833 | ## Copy the Test File to the Real RClone Conf 834 | cat /pg/rclone/test.conf >> /pg/rclone/blitz.conf 835 | 836 | ## Back to the Main Mount Menu 837 | mountsmenu 838 | 839 | EOF 840 | } 841 | 842 | deploychecks () { 843 | secret=$(cat /pg/rclone/pgclone.secret) 844 | public=$(cat /pg/rclone/pgclone.public) 845 | teamdrive=$(cat /pg/rclone/pgclone.teamdrive) 846 | 847 | if [ "$secret" == "" ]; then 848 | tee <<-EOF 849 | 850 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 851 | ⛔ ERROR: Secret Key Is Blank! Unable to Deploy! 852 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 853 | 854 | EOF 855 | read -p '↘️ Acknowledge Info | Press [Enter] ' typed < /dev/tty 856 | question1; fi 857 | 858 | if [ "$public" == "" ]; then 859 | tee <<-EOF 860 | 861 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 862 | ⛔ ERROR: Client ID Is Blank! Unable to Deploy! 863 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 864 | 865 | EOF 866 | read -p '↘️ Acknowledge Info | Press [Enter] ' typed < /dev/tty 867 | question1; fi 868 | } 869 | -------------------------------------------------------------------------------- /functions/projectname.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | projectname () { 9 | pgclonevars 10 | 11 | ############## REMINDERS 12 | # Make destroying piece quiet and create a manual delete confirmatino 13 | # When user creates project, give them the option to switch 14 | # fix existing set project 15 | 16 | ############## REMINDERS 17 | 18 | # prevents user from moving on unless email is set 19 | if [[ "$pgcloneemail" == "NOT-SET" ]]; then 20 | echo 21 | echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" 22 | read -p '↘️ ERROR! E-Mail is not setup! | Press [ENTER] ' typed < /dev/tty 23 | clonestart; fi 24 | 25 | projectcheck="good" 26 | if [[ $(gcloud projects list --account=${pgcloneemail} | grep "pg-") == "" ]]; then 27 | projectcheck="bad"; fi 28 | 29 | # prompt user 30 | tee <<-EOF 31 | 32 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 33 | 🚀 PG Clone - Project ~ pgclone.pgblitz.com 34 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 35 | 36 | CURRENT PROJECT: $pgcloneproject 37 | 38 | [1] Project: Use Existing Project 39 | [2] Project: Build New & Set Project 40 | [3] Project: Destroy 41 | [Z] Exit 42 | 43 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 44 | EOF 45 | read -p '↘️ Input Value | Press [Enter]: ' typed < /dev/tty 46 | 47 | case $typed in 48 | 1 ) 49 | if [[ "$projectcheck" == "bad" ]]; then 50 | echo "BAD" 51 | clonestart 52 | elif [[ "$projectcheck" == "good" ]]; then 53 | exisitingproject; fi ;; 54 | 2 ) 55 | projectnameset 56 | buildproject ;; 57 | 58 | 3 ) 59 | destroyproject ;; 60 | Z ) 61 | clonestart ;; 62 | z ) 63 | clonestart ;; 64 | * ) 65 | keyinputpublic ;; 66 | esac 67 | 68 | } 69 | 70 | exisitingproject () { 71 | tee <<-EOF 72 | 73 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 74 | 🚀 PG Clone - Existing Project ~ pgclone.pgblitz.com 75 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 76 | 77 | EOF 78 | projectlist 79 | tee <<-EOF 80 | 81 | Qutting? Type >>> Exit 82 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 83 | EOF 84 | read -p '↘️ Use Which Existing Project? | Press [ENTER]: ' typed < /dev/tty 85 | if [[ "$typed" == "Exit" || "$typed" == "exit" || "$typed" == "EXIT" ]]; then clonestart; fi 86 | 87 | # Repeats if Users Fails the Range 88 | if [[ "$typed" -ge "1" && "$typed" -le "$pnum" ]]; then 89 | existingnumber=$(cat /pg/var/prolist/$typed) 90 | 91 | echo 92 | gcloud config set project ${existingnumber} --account=${pgcloneemail} 93 | 94 | tee <<-EOF 95 | 96 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97 | 🚀 PG Clone - Enabling Your API (Standby) ~ pgclone.pgblitz.com 98 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 99 | 100 | EOF 101 | gcloud services enable drive.googleapis.com --project ${existingnumber} --account=${pgcloneemail} 102 | else exisitingproject; fi 103 | echo 104 | read -p '↘️ Existing Project Set | Press [ENTER] ' typed < /dev/tty 105 | echo "${existingnumber}" > /pg/rclone/pgclone.project 106 | clonestart 107 | } 108 | 109 | destroyproject () { 110 | tee <<-EOF 111 | 112 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 113 | 🚀 PG Clone - Destroy Project ~ pgclone.pgblitz.com 114 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 115 | 116 | EOF 117 | projectlist 118 | tee <<-EOF 119 | 120 | Qutting? Type >>> Exit 121 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 122 | EOF 123 | read -p '↘️ Destroy Which Project? | Press [ENTER]: ' typed < /dev/tty 124 | if [[ "$typed" == "Exit" || "$typed" == "exit" || "$typed" == "EXIT" ]]; then optionsmenu; fi 125 | 126 | # Repeats if Users Fails the Range 127 | if [[ "$typed" -ge "1" && "$typed" -le "$pnum" ]]; then 128 | destroynumber=$(cat /pg/var/prolist/$typed) 129 | 130 | # Cannot Destroy Active Project 131 | if [[ $(cat /pg/rclone/pgclone.project) == "$destroynumber" ]]; then 132 | echo 133 | read -p '↘️ Unable to Destroy an Active Project | Press [ENTER] ' typed < /dev/tty 134 | destroyproject 135 | fi 136 | 137 | echo 138 | gcloud projects delete ${destroynumber} --account=${pgcloneemail} 139 | else destroyproject; fi 140 | echo 141 | read -p '↘️ Project Deleted | Press [ENTER] ' typed < /dev/tty 142 | optionsmenu 143 | } 144 | 145 | projectlist () { 146 | pnum=0 147 | mkdir -p /pg/var/prolist 148 | rm -rf /pg/var/prolist/* 1>/dev/null 2>&1 149 | 150 | gcloud projects list --account=${pgcloneemail} | tail -n +2 | awk '{print $1}' > /pg/var/prolist/prolist.sh 151 | 152 | while read p; do 153 | let "pnum++" 154 | echo "$p" > "/pg/var/prolist/$pnum" 155 | echo "[$pnum] $p" >> /pg/var/prolist/final.sh 156 | echo "[$pnum] ${filler}${p}" 157 | done /pg/rclone/pgclone.project 258 | 259 | tee <<-EOF 260 | 261 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 262 | 🚀 PG Clone - Resetting Prior Stored Information 263 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 264 | EOF 265 | rm -rf /pg/rclone/pgclone.secret 1>/dev/null 2>&1 266 | rm -rf /pg/rclone/pgclone.public 1>/dev/null 2>&1 267 | rm -rf /pg/rclone/pgclone.secret 1>/dev/null 2>&1 268 | rm -rf /pg/rclone/.sd 1>/dev/null 2>&1 269 | rm -rf /pg/rclone/.gd 1>/dev/null 2>&1 270 | rm -rf /pg/rclone/.gc 1>/dev/null 2>&1 271 | rm -rf /pg/rclone/.sc 1>/dev/null 2>&1 272 | rm -rf /pg/rclone/pgclone.teamdrive 1>/dev/null 2>&1 273 | rm -rf /pg/rclone/deployed.version 1>/dev/null 2>&1 274 | 275 | docker stop jellyfin 1>/dev/null 2>&1 276 | docker stop plex 1>/dev/null 2>&1 277 | docker stop emby 1>/dev/null 2>&1 278 | docker rm jellyfin 1>/dev/null 2>&1 279 | docker rm plex 1>/dev/null 2>&1 280 | docker rm emby 1>/dev/null 2>&1 281 | 282 | ansible-playbook /pg/pgclone/ymls/remove.yml 283 | tee <<-EOF 284 | 285 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 286 | 🚀 PG Clone - Prior Stored Information is Reset! 287 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 288 | 289 | NOTE: If Plex, Emby, and/or JellyFin was deployed; redeploy them through 290 | PG Box when complete! Ensuring that the containers do not self erase 291 | meta-data due to the mounts being offline! 292 | 293 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 294 | EOF 295 | 296 | read -p '↘️ Acknowledge Info | Press [ENTER] ' typed < /dev/tty 297 | clonestart 298 | } 299 | -------------------------------------------------------------------------------- /functions/publicsecret.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | keyinputpublic () { 9 | pgclonevars 10 | if [[ "$pgcloneid" == "ACTIVE" ]]; then 11 | tee <<-EOF 12 | 13 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14 | 🚀 PG Clone - Change Values? ~ pgclone.pgblitz.com 15 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16 | CLIENT ID 17 | $pgclonepublic 18 | 19 | SECRET ID 20 | $pgclonesecret 21 | 22 | WARNING: Changing the values will RESET & DELETE the following: 23 | 1. GDrive 24 | 2. SDrive 25 | 3. Service Keys 26 | 27 | Change the Stored Values? 28 | [1] No [2] Yes 29 | 30 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 31 | EOF 32 | read -p '↘️ Input Value | Press [Enter]: ' typed < /dev/tty 33 | case $typed in 34 | 2 ) 35 | rm -rf /pg/rclone/.gc 1>/dev/null 2>&1 36 | rm -rf /pg/rclone/.gd 1>/dev/null 2>&1 37 | rm -rf /pg/rclone/.sc 1>/dev/null 2>&1 38 | rm -rf /pg/rclone/.sd 1>/dev/null 2>&1 39 | rm -rf /pg/rclone/pgclone.teamdrive 1>/dev/null 2>&1 40 | rm -rf /pg/rclone/pgclone.public 1>/dev/null 2>&1 41 | rm -rf /pg/rclone/pgclone.secret 1>/dev/null 2>&1 42 | ;; 43 | 1 ) 44 | clonestart ;; 45 | * ) 46 | keyinputpublic ;; 47 | esac 48 | 49 | fi 50 | 51 | tee <<-EOF 52 | 53 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 54 | 🚀 PG Clone - Client ID ~ pgclone.pgblitz.com 55 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 56 | 57 | Visit oauth.pgblitz.com in order to generate your Client ID! Ensure that 58 | you input the CORRECT Client ID from your current project! 59 | 60 | Quitting? Type > exit 61 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62 | EOF 63 | 64 | read -p '↘️ Client ID | Press [Enter]: ' clientid < /dev/tty 65 | if [ "$clientid" = "" ]; then keyinput; fi 66 | if [ "$clientid" = "exit" ]; then clonestart; fi 67 | keyinputsecret 68 | } 69 | 70 | keyinputsecret () { 71 | tee <<-EOF 72 | 73 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 74 | 🚀 PG Clone - Secret ~ pgclone.pgblitz.com 75 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 76 | 77 | Visit oauth.pgblitz.com in order to generate your Secret! Ensure that 78 | you input the CORRECT Secret ID from your current project! 79 | 80 | Quitting? Type > exit 81 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 82 | EOF 83 | 84 | read -p '↘️ Secret ID | Press [Enter]: ' secretid < /dev/tty 85 | if [ "$secretid" = "" ]; then keyinputsecret; fi 86 | if [ "$secretid" = "exit" ]; then clonestart; fi 87 | 88 | tee <<-EOF 89 | 90 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 91 | 🚀 PG Clone - Output ~ pgclone.pgblitz.com 92 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 93 | 94 | CLIENT ID 95 | $clientid 96 | 97 | SECRET ID 98 | $secretid 99 | 100 | Is the following information correct? 101 | [1] Yes 102 | [2] No 103 | [Z] Exit 104 | 105 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 106 | EOF 107 | 108 | read -p '↘️ Input Information | Press [Enter]: ' typed < /dev/tty 109 | 110 | case $typed in 111 | 1 ) 112 | echo "$clientid" > /pg/rclone/pgclone.public 113 | echo "$secretid" > /pg/rclone/pgclone.secret 114 | echo 115 | echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" 116 | read -p '↘️ Information Stored | Press [Enter] ' secretid < /dev/tty 117 | echo "SET" > /pg/rclone/pgclone.id 118 | ;; 119 | 2 ) 120 | echo 121 | echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" 122 | read -p '↘️ Restarting Process | Press [Enter] ' secretid < /dev/tty 123 | keyinputpublic 124 | ;; 125 | z ) 126 | echo 127 | echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" 128 | read -p '↘️ Nothing Saved! Exiting! | Press [Enter] ' secretid < /dev/tty 129 | ;; 130 | Z ) 131 | echo 132 | echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" 133 | read -p '↘️ Nothing Saved! Exiting! | Press [Enter] ' secretid < /dev/tty 134 | ;; 135 | * ) 136 | clonestart ;; 137 | esac 138 | clonestart 139 | } 140 | 141 | publicsecretchecker () { 142 | pgclonevars 143 | if [[ "$pgcloneid" == "NOT-SET" ]]; then 144 | 145 | tee <<-EOF 146 | 147 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 148 | 🌎 Fail Notice ~ oauth.pgblitz.com 149 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 150 | 151 | 💬 Public & Secret Key - NOT SET! 152 | 153 | NOTE: Nothing can occur unless the public & secret key are set! Without 154 | setting them; PGBlitz cannot create keys, nor create rclone configurations 155 | to mount the required drives! 156 | 157 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 158 | EOF 159 | read -p '↘️ Acknowledge Info | Press [ENTER] ' typed < /dev/tty 160 | clonestart 161 | fi 162 | } 163 | -------------------------------------------------------------------------------- /functions/rcloneinstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | rcloneinstall () { 9 | 10 | # install what version of rclone 11 | rversion=1.53.2 12 | 13 | rcheck1=$(rclone --version 2>&1) 14 | rcheck2=$(echo $rcheck1 | cut -c1-12) 15 | 16 | if [[ "rclone v$rversion" != "$rcheck2" ]]; then 17 | 18 | tee <<-EOF 19 | 20 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 21 | 💪 Installing RClone Version ~ $rversion 22 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 23 | 24 | EOF 25 | sleep 1.5 26 | 27 | tee "/etc/fuse.conf" > /dev/null < /pg/rclone/pgclone.transport ;; 30 | 2 ) 31 | echo "gc" > /pg/rclone/pgclone.transport ;; 32 | 3 ) 33 | echo "sd" > /pg/rclone/pgclone.transport ;; 34 | 4 ) 35 | echo "sc" > /pg/rclone/pgclone.transport ;; 36 | 5 ) 37 | echo "le" > /pg/rclone/pgclone.transport ;; 38 | * ) 39 | transportselect ;; 40 | esac 41 | } 42 | -------------------------------------------------------------------------------- /functions/uagent.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | uagent () { 9 | pgclonevars 10 | 11 | tee <<-EOF 12 | 13 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14 | 🚀 User Agent for RClone 15 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16 | 17 | NOTE: Please never use this code below !!! 18 | NOTE: some user try it and all mounts are stoped 19 | 20 | --user-agent:="Mozilla/5.0 (Windows NT 10.0; WOW64) ......" 21 | 22 | Current User Agent: ${uagent} 23 | 24 | Changing the useragent is useful when experience 429 problems from Google 25 | Examples: 26 | 27 | Quitting? Type >>> exit 28 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 29 | EOF 30 | read -p '↘️ Type User Agent | PRESS [ENTER]: ' varinput < /dev/tty 31 | if [[ "$varinput" == "exit" || "$varinput" == "Exit" || "$varinput" == "EXIT" ]]; then clonestart; fi 32 | 33 | echo "$varinput" > /pg/var/uagent 34 | } 35 | -------------------------------------------------------------------------------- /functions/variables.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | pgclonevars () { 9 | 10 | variablet () { 11 | file="$1" 12 | if [ ! -e "$file" ]; then touch "$1"; fi 13 | } 14 | 15 | # rest standard 16 | mkdir -p /pg/logs /pg/rclone 17 | touch /pg/logs/gd.log /pg/logs/sd.log /pg/logs/ge.log /pg/logs/se.log /pg/logs/pgblitz.log /pg/logs/transport.log 18 | 19 | variable /pg/var/project.account "NOT-SET" 20 | variable /pg/rclone/deploy.version "null" 21 | variable /pg/rclone/pgclone.transport "NOT-SET" 22 | variable /pg/var/move.bw "9" 23 | variable /pg/var/blitz.bw "1000" 24 | variable /pg/rclone/pgclone.salt "" 25 | variable /pg/var/multihd.paths "" 26 | 27 | variable /pg/var/server.hd.path "/pg" 28 | hdpath=$(cat /pg/var/server.hd.path) 29 | 30 | variable /pg/rclone/oauth.check "" 31 | oauthcheck=$(cat /pg/rclone/oauth.check) 32 | 33 | variable /pg/rclone/pgclone.password "NOT-SET" 34 | if [[ $(cat /pg/rclone/pgclone.password) == "NOT-SET" ]]; then pstatus="NOT-SET" 35 | else 36 | pstatus="ACTIVE" 37 | clonepassword=$(cat /pg/rclone/pgclone.password) 38 | clonesalt=$(cat /pg/rclone/pgclone.salt) 39 | fi 40 | 41 | variable /pg/rclone/.gd "NOT-SET" 42 | if [[ $(cat /pg/rclone/.gd) == "NOT-SET" ]]; then gdstatus="NOT-SET" 43 | else gdstatus="ACTIVE"; fi 44 | 45 | variable /pg/rclone/.sd "NOT-SET" 46 | if [[ $(cat /pg/rclone/.sd) == "NOT-SET" ]]; then sdstatus="NOT-SET" 47 | else sdstatus="ACTIVE"; fi 48 | 49 | variable /pg/rclone/.sc "NOT-SET" 50 | if [[ $(cat /pg/rclone/.sc) == "NOT-SET" ]]; then scstatus="NOT-SET" 51 | else scstatus="ACTIVE"; fi 52 | 53 | variable /pg/rclone/.gc "NOT-SET" 54 | if [[ $(cat /pg/rclone/.gc) == "NOT-SET" ]]; then gcstatus="NOT-SET" 55 | else gcstatus="ACTIVE"; fi 56 | 57 | transport=$(cat /pg/rclone/pgclone.transport) 58 | 59 | variable /pg/rclone/pgclone.teamdrive "NOT-SET" 60 | sdname=$(cat /pg/rclone/pgclone.teamdrive) 61 | 62 | variable /pg/rclone/pgclone.demo "OFF" 63 | demo=$(cat /pg/rclone/pgclone.demo) 64 | 65 | variable /pg/rclone/pgclone.teamid "" 66 | sdid=$(cat /pg/rclone/pgclone.teamid) 67 | 68 | variable /pg/rclone/deploy.version "" 69 | type=$(cat /pg/rclone/deploy.version) 70 | 71 | variable /pg/rclone/pgclone.public "" 72 | pgclonepublic=$(cat /pg/rclone/pgclone.public) 73 | 74 | mkdir -p /pg/var/.blitzkeys 75 | displaykey=$(ls /pg/var/.blitzkeys | wc -l) 76 | 77 | variable /pg/rclone/pgclone.secret "" 78 | pgclonesecret=$(cat /pg/rclone/pgclone.secret) 79 | 80 | if [[ "$pgclonesecret" == "" || "$pgclonepublic" == "" ]]; then pgcloneid="NOT-SET"; fi 81 | if [[ "$pgclonesecret" != "" && "$pgclonepublic" != "" ]]; then pgcloneid="ACTIVE"; fi 82 | 83 | variable /pg/rclone/pgclone.email "NOT-SET" 84 | pgcloneemail=$(cat /pg/rclone/pgclone.email) 85 | 86 | variable /pg/var/oauth.type "NOT-SET" #output for auth type 87 | oauthtype=$(cat /pg/var/oauth.type) 88 | 89 | variable /pg/rclone/pgclone.project "NOT-SET" 90 | pgcloneproject=$(cat /pg/rclone/pgclone.project) 91 | 92 | variable /pg/rclone/deployed.version "" 93 | dversion=$(cat /pg/rclone/deployed.version) 94 | 95 | variablet /pg/var/.tmp.multihd 96 | multihds=$(cat /pg/var/.tmp.multihd) 97 | 98 | if [[ "$dversion" == "gd" ]]; then dversionoutput="GDrive Unencrypted" 99 | elif [[ "$dversion" == "gc" ]]; then dversionoutput="GDrive Encrypted" 100 | elif [[ "$dversion" == "sd" ]]; then dversionoutput="SDrive Unencrypted" 101 | elif [[ "$dversion" == "sc" ]]; then dversionoutput="SDrive Encrypted" 102 | elif [[ "$dversion" == "le" ]]; then dversionoutput="Local HD/Mount" 103 | else dversionoutput="None"; fi 104 | 105 | # For Clone Clean 106 | variable /pg/var/cloneclean "600" 107 | cloneclean=$(cat /pg/var/cloneclean) 108 | 109 | # Copy JSON if Missing 110 | if [ ! -e "/pg/rclone/pgclone.json" ]; then cp /pg/pgclone/pgclone.json /pg/rclone/pgclone.json; fi 111 | 112 | # For PG Blitz Mounts 113 | bs=$(jq -r '.bs' /pg/rclone/pgclone.json) 114 | dcs=$(jq -r '.dcs' /pg/rclone/pgclone.json) 115 | dct=$(jq -r '.dct' /pg/rclone/pgclone.json) 116 | cma=$(jq -r '.cma' /pg/rclone/pgclone.json) 117 | rcs=$(jq -r '.rcs' /pg/rclone/pgclone.json) 118 | rcsl=$(jq -r '.rcsl' /pg/rclone/pgclone.json) 119 | cm=$(jq -r '.cm' /pg/rclone/pgclone.json) 120 | cms=$(jq -r '.cms' /pg/rclone/pgclone.json) 121 | 122 | randomagent=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) 123 | variable /pg/var/uagent "$randomagent" 124 | uagent=$(cat /pg/var/uagent) 125 | } 126 | -------------------------------------------------------------------------------- /mounts/crypt.service: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | [Unit] 9 | Description={{drive}} Daemon 10 | After=multi-user.target 11 | 12 | [Service] 13 | Type=simple 14 | User=0 15 | Group=0 16 | ExecStart=/usr/bin/rclone mount {{drive}}: /pg/{{drive}} \ 17 | --config /pg/rclone/blitz.conf \ 18 | --allow-non-empty \ 19 | --allow-other \ 20 | --size-only \ 21 | --uid=1000 --gid=1000 \ 22 | --umask 002 \ 23 | --log-file=/pg/logs/{{drive}}.log \ 24 | --log-level INFO \ 25 | --drive-use-trash=false \ 26 | --timeout 1h \ 27 | --vfs-cache-mode writes \ 28 | --dir-cache-time {{dct}} \ 29 | --vfs-cache-max-age {{cma}} \ 30 | --vfs-read-chunk-size {{rcs}} \ 31 | --vfs-read-chunk-size-limit {{rcsl}} \ 32 | --drive-chunk-size {{dcs}} \ 33 | --user-agent={{uagent.stdout}} \ 34 | --buffer-size {{bs}} 35 | 36 | ExecStop=/bin/fusermount -uz /pg/{{drive}} 37 | TimeoutStopSec=20 38 | KillMode=process 39 | RemainAfterExit=yes 40 | 41 | [Install] 42 | WantedBy=multi-user.target 43 | -------------------------------------------------------------------------------- /mounts/drive.service: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | [Unit] 9 | Description={{drive}} Daemon 10 | After=multi-user.target 11 | 12 | [Service] 13 | Type=simple 14 | User=0 15 | Group=0 16 | ExecStart=/usr/bin/rclone mount {{drive}}: /pg/{{drive}} \ 17 | --config /pg/rclone/blitz.conf \ 18 | --allow-non-empty \ 19 | --allow-other \ 20 | --size-only \ 21 | --uid=1000 --gid=1000 \ 22 | --umask 002 \ 23 | --log-file=/pg/logs/{{drive}}.log \ 24 | --log-level INFO \ 25 | --timeout 1h \ 26 | --drive-use-trash=false \ 27 | --dir-cache-time {{dct}} \ 28 | --vfs-cache-max-age {{cma}} \ 29 | --vfs-read-chunk-size {{rcs}} \ 30 | --vfs-read-chunk-size-limit {{rcsl}} \ 31 | --drive-chunk-size {{dcs}} \ 32 | --user-agent={{uagent.stdout}} \ 33 | --buffer-size {{bs}} 34 | 35 | ExecStop=/bin/fusermount -uz /pg/{{drive}} 36 | TimeoutStopSec=20 37 | KillMode=process 38 | RemainAfterExit=yes 39 | 40 | [Install] 41 | WantedBy=multi-user.target 42 | -------------------------------------------------------------------------------- /mounts/pgunity.service: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | [Unit] 9 | Description='PGBlitz.com Unity Service' 10 | After=multi-user.target 11 | 12 | [Service] 13 | Type=simple 14 | User=0 15 | Group=0 16 | ExecStart=/bin/bash /pg/rclone/pgunity.sh 17 | ExecStop=/bin/fusermount -uz /pg/unity 18 | TimeoutStopSec=20 19 | KillMode=process 20 | RemainAfterExit=yes 21 | 22 | [Install] 23 | WantedBy=multi-user.target 24 | -------------------------------------------------------------------------------- /mounts/transfer.service: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | [Unit] 9 | Description='PGBlitz.com Transfer Service' 10 | After=multi-user.target network-online.target 11 | 12 | [Service] 13 | Type=simple 14 | User=0 15 | Group=0 16 | ExecStart=/bin/bash /pg/pgclone/source/loop.sh 17 | TimeoutStopSec=20 18 | KillMode=process 19 | RemainAfterExit=yes 20 | Restart=always 21 | 22 | [Install] 23 | WantedBy=multi-user.target 24 | -------------------------------------------------------------------------------- /pgclone.json: -------------------------------------------------------------------------------- 1 | { 2 | "_comment": "Visit http://clonevalues.pgblitz.com", 3 | "version": 1, 4 | "bs": "16M", 5 | "dcs": "128M", 6 | "dct": "5m", 7 | "cma": "1h", 8 | "rcs": "64M", 9 | "rcsl": "1024M", 10 | "cm": "writes", 11 | "cms": "off", 12 | "drive": "", 13 | "resetvalues": "no" 14 | } 15 | -------------------------------------------------------------------------------- /pgclone.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: PGBlitz.com (Reference Title File - PGBlitz) 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | source /pg/pgclone/functions/functions.sh 9 | source /pg/pgclone/functions/variables.sh 10 | source /pg/pgclone/functions/mountnumbers.sh 11 | source /pg/pgclone/functions/keys.sh 12 | source /pg/pgclone/functions/keyback.sh 13 | source /pg/pgclone/functions/pgclone.sh 14 | source /pg/pgclone/functions/gaccount.sh 15 | source /pg/pgclone/functions/publicsecret.sh 16 | source /pg/pgclone/functions/variables.sh 17 | source /pg/pgclone/functions/transportselect.sh 18 | source /pg/pgclone/functions/projectname.sh 19 | source /pg/pgclone/functions/clonestartoutput.sh 20 | source /pg/pgclone/functions/oauth.sh 21 | source /pg/pgclone/functions/passwords.sh 22 | source /pg/pgclone/functions/oauthcheck.sh 23 | source /pg/pgclone/functions/keysbuild.sh 24 | source /pg/pgclone/functions/emails.sh 25 | source /pg/pgclone/functions/deploy.sh 26 | source /pg/pgclone/functions/rcloneinstall.sh 27 | source /pg/pgclone/functions/deploytransfer.sh 28 | source /pg/pgclone/functions/deploysdrive.sh 29 | source /pg/pgclone/functions/multihd.sh 30 | source /pg/pgclone/functions/deploylocal.sh 31 | source /pg/pgclone/functions/createsdrive.sh 32 | source /pg/pgclone/functions/cloneclean.sh 33 | source /pg/pgclone/functions/uagent.sh 34 | ################################################################################ 35 | rcloneinstall 36 | 37 | # (functions.sh) Ensures variables and folders exist 38 | pgclonevars 39 | 40 | # (functions.sh) User cannot proceed until they set transport and data type 41 | mustset 42 | 43 | # (functions.sh) Ensures that fuse is set correct for rclone 44 | rcpiece 45 | 46 | clonestart 47 | -------------------------------------------------------------------------------- /place.holder: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /rclone.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: localhost 3 | vars: 4 | extra: "" 5 | 6 | roles: 7 | - { role: rcloneinstall, tags: ["rcloneinstall"] } -------------------------------------------------------------------------------- /roles/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PGBlitz/PGClone/156c0cc99e28e8640c734b9ec628ca30ae0e1b81/roles/.DS_Store -------------------------------------------------------------------------------- /roles/rcloneinstall/.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: python 3 | python: "2.7" 4 | 5 | sudo: required 6 | dist: bionic 7 | services: 8 | - docker 9 | 10 | env: 11 | - distribution: centos 12 | version: 7 13 | # - distribution: centos 14 | # version: 6 # package issue with mandb 15 | - distribution: fedora 16 | version: 25 17 | - distribution: ubuntu 18 | version: 18.04 19 | - distribution: ubuntu 20 | version: 16.04 21 | - distribution: ubuntu 22 | version: 14.04 23 | - distribution: ubuntu 24 | version: 12.04 25 | 26 | before_install: 27 | - 'sudo docker run -it --name=ansible-rclone --privileged --detach --volume="${PWD}":/etc/ansible/roles/ansible-rclone:rw spikebyte/docker:latest-${distribution}-${version} bash' 28 | 29 | script: 30 | # 1. Syntax check 31 | - "sudo docker exec ansible-rclone ansible-playbook /etc/ansible/roles/ansible-rclone/tests/test.yml -i tests/inventory --syntax-check" 32 | 33 | # 2. Run playbook to execute role 34 | - "sudo docker exec ansible-rclone ansible-playbook /etc/ansible/roles/ansible-rclone/tests/test.yml -i tests/inventory --connection=local" 35 | 36 | # 3. HERE, WRITE SOME TESTS to verify that your role has produced the desired 37 | # effect on the target system. Your tests should be bash commands that 38 | # complete with an exit status of 0 for a pass, and non-zero for a failure. 39 | # 40 | # This example tests whether 'hello' exists in /tmp/hello.txt. 41 | - > 42 | sudo docker exec ansible-rclone bash -c 'file /usr/sbin/rclone' | grep -q 'executable' 43 | && (echo 'Test for role result: pass' && exit 0) 44 | || (echo 'Test for role result: fail' && exit 1) 45 | 46 | # 4. Idempotence test (run playbook again to confirm nothing changes) 47 | - > 48 | sudo docker exec ansible-rclone ansible-playbook /etc/ansible/roles/ansible-rclone/tests/test.yml -i tests/inventory --connection=local 49 | | grep -q 'changed=0.*failed=0' 50 | && (echo 'Idempotence test: pass' && exit 0) 51 | || (echo 'Idempotence test: fail' && exit 1) 52 | 53 | 54 | notifications: 55 | webhooks: 56 | urls: 57 | - https://galaxy.ansible.com/api/v1/notifications 58 | on_success: always 59 | on_failure: never 60 | -------------------------------------------------------------------------------- /roles/rcloneinstall/README.md: -------------------------------------------------------------------------------- 1 | # ansible-rclone 2 | 3 | ansible role to install [rclone](https://github.com/ncw/rclone) 4 | 5 | Usage: 6 | 7 | 1. clone this repo into your local roles-directory 8 | 2. add role to the hosts you want rclone installed to: 9 | 3. The variable `rclone_version` can be defined as a release on github or `beta`. 10 | 11 | ``` --- 12 | - hosts: rclone-hosts 13 | roles: 14 | - rclone 15 | ``` 16 | -------------------------------------------------------------------------------- /roles/rcloneinstall/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | #rclone version can be defined as a release number or as beta 3 | rclone_version: "1.53.2" 4 | 5 | # Defaults in case no variables for OS are chosen 6 | PACKAGES: 7 | - unzip 8 | 9 | MAN_PAGES: 10 | OWNER: root 11 | GROUP: root 12 | -------------------------------------------------------------------------------- /roles/rcloneinstall/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | dependencies: [] 4 | 5 | galaxy_info: 6 | author: 'Stefan G. Weichinger' 7 | description: 'Install rclone' 8 | company: 'oops' 9 | license: 'GNU General Public License v3' 10 | min_ansible_version: '2.0' 11 | platforms: 12 | - name: Debian 13 | versions: 14 | - jessie 15 | - name: Ubuntu 16 | versions: 17 | - xenial 18 | - name: RHEL 19 | categories: 20 | - networking 21 | - system 22 | -------------------------------------------------------------------------------- /roles/rcloneinstall/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - debug: var=ansible_os_family 3 | - name: gather os specific variables 4 | include_vars: "{{ item }}" 5 | with_first_found: 6 | - '{{ ansible_distribution }}-{{ ansible_distribution_major_version}}.yml' 7 | - '{{ ansible_distribution }}.yml' 8 | - '{{ ansible_os_family }}.yml' 9 | tags: 10 | - vars 11 | 12 | - name: rclone - define tmpdir 13 | set_fact: 14 | rclone_setup_tmp_dir: "/tmp/rclone_setup" 15 | 16 | - name: Install required packages 17 | package: 18 | name: '{{ item }}' 19 | state: latest 20 | become: yes 21 | with_items: '{{ PACKAGES }}' 22 | 23 | - name: install rclone - make temp dir 24 | file: 25 | path: "{{ rclone_setup_tmp_dir}}" 26 | state: directory 27 | mode: 0775 28 | 29 | - name: install rclone - unzip package 30 | unarchive: 31 | src: https://github.com/ncw/rclone/releases/download/v{{ rclone_version }}/rclone-v{{ rclone_version }}-linux-amd64.zip 32 | dest: "{{ rclone_setup_tmp_dir}}" 33 | copy: no 34 | creates: '/tmp/rclone_setup/rclone-v{{ rclone_version }}-linux-amd64' 35 | when: rclone_version != 'beta' 36 | become: yes 37 | 38 | - name: install rclone - download file containing current beta version number 39 | get_url: 40 | url: https://beta.rclone.org/version.txt 41 | dest: '{{ rclone_setup_tmp_dir }}/version.txt' 42 | when: rclone_version == "beta" 43 | 44 | - name: install rclone - read in beta version number from {{ rclone_setup_tmp_dir }}/version.txt 45 | slurp: 46 | src: '{{ rclone_setup_tmp_dir }}/version.txt' 47 | register: rclone_version_beta 48 | when: rclone_version == 'beta' 49 | 50 | - name: install rclone - format rclone_beta_version variable and redefine as rclone_version 51 | set_fact: 52 | rclone_version: "{{ rclone_version_beta['content'] | b64decode | replace ('rclone v', '', 1) | trim }}" 53 | when: rclone_version == 'beta' 54 | 55 | - name: install rclone - unzip package 56 | unarchive: 57 | src: https://beta.rclone.org/rclone-beta-latest-linux-amd64.zip 58 | dest: "{{ rclone_setup_tmp_dir}}" 59 | copy: no 60 | creates: '/tmp/rclone_setup/rclone-v{{ rclone_version }}-linux-amd64' 61 | when: rclone_version_beta 62 | become: yes 63 | 64 | - name: install rclone - copy binary 65 | copy: 66 | src: "{{ rclone_setup_tmp_dir}}/rclone-v{{ rclone_version }}-linux-amd64/rclone" 67 | dest: "/usr/bin/rclone" 68 | mode: 0755 69 | owner: root 70 | group: root 71 | remote_src: True 72 | become: yes 73 | 74 | - name: install rclone - make dir for local manpages 75 | file: 76 | path: '{{ MAN_PAGES.PATH }}' 77 | state: directory 78 | mode: 0775 79 | owner: '{{ MAN_PAGES.OWNER }}' 80 | group: '{{ MAN_PAGES.GROUP }}' 81 | become: yes 82 | 83 | - name: install rclone - copy manpage 84 | copy: 85 | src: "{{ rclone_setup_tmp_dir}}/rclone-v{{ rclone_version }}-linux-amd64/rclone.1" 86 | dest: "{{ MAN_PAGES.PATH }}/rclone.1" 87 | mode: 0644 88 | owner: root 89 | group: root 90 | remote_src: True 91 | become: yes 92 | 93 | - name: install rclone - install manpage 94 | shell: mandb 95 | become: yes 96 | changed_when: false 97 | -------------------------------------------------------------------------------- /roles/rcloneinstall/tests/inventory: -------------------------------------------------------------------------------- 1 | localhost -------------------------------------------------------------------------------- /roles/rcloneinstall/tests/test.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: localhost 3 | remote_user: root 4 | roles: 5 | - ansible-rclone 6 | -------------------------------------------------------------------------------- /roles/rcloneinstall/vars/CentOS-6.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | PACKAGES: 4 | - unzip 5 | - man 6 | 7 | MAN_PAGES: 8 | OWNER: root 9 | GROUP: root 10 | PATH: '/usr/local/share/man/man1' 11 | -------------------------------------------------------------------------------- /roles/rcloneinstall/vars/Debian.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | PACKAGES: 4 | - unzip 5 | 6 | MAN_PAGES: 7 | OWNER: root 8 | GROUP: root 9 | PATH: '/usr/share/man/man1' 10 | -------------------------------------------------------------------------------- /roles/rcloneinstall/vars/Linuxmint.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | PACKAGES: 4 | - unzip 5 | - man-db 6 | 7 | MAN_PAGES: 8 | OWNER: root 9 | GROUP: root 10 | PATH: '/usr/local/share/man/man1' 11 | -------------------------------------------------------------------------------- /roles/rcloneinstall/vars/RedHat.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | PACKAGES: 4 | - unzip 5 | - man 6 | - file 7 | 8 | MAN_PAGES: 9 | OWNER: root 10 | GROUP: root 11 | PATH: '/usr/local/share/man/man1' 12 | -------------------------------------------------------------------------------- /roles/rcloneinstall/vars/Ubuntu.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | PACKAGES: 4 | - unzip 5 | - man-db 6 | 7 | MAN_PAGES: 8 | OWNER: root 9 | GROUP: root 10 | PATH: '/usr/local/share/man/man1' 11 | -------------------------------------------------------------------------------- /source/cloneclean.sh: -------------------------------------------------------------------------------- 1 | ### Falls under PG Prune for Execution to Save Time & Sanity 2 | 3 | # Outside Variables 4 | dlpath=$(cat /pg/var/server.hd.path) 5 | cleaner="$(cat /pg/var/cloneclean)" 6 | 7 | # Starting Actions 8 | touch /pg/logs/pgblitz.log 9 | mkdir -p "$dlpath/move" 10 | 11 | # Repull excluded folder 12 | wget -qN https://raw.githubusercontent.com/PGBlitz/PGClone/v8.6/functions/exclude -P /pg/var/ 13 | 14 | # Permissions 15 | chown -R 1000:1000 "$dlpath/move" 16 | chmod -R 775 "$dlpath/move" 17 | 18 | # Remove empty directories 19 | find "$dlpath/move/" -type d -mmin +2 -empty -exec rm -rf {} \; 20 | 21 | # Removes garbage 22 | find "$dlpath/downloads" -mindepth 2 -type d -cmin +$cleaner $(printf "! -name %s " $(cat /pg/var/exclude)) -empty -exec rm -rf {} \; 23 | find "$dlpath/downloads" -mindepth 2 -type f -cmin +$cleaner $(printf "! -name %s " $(cat /pg/var/exclude)) -size +1M -exec rm -rf {} \; 24 | -------------------------------------------------------------------------------- /source/local.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | sleep 2 9 | 10 | chown -R 1000:1000 "{{hdpath}}/downloads" 11 | chmod -R 755 "{{hdpath}}/downloads" 12 | chown -R 1000:1000 "{{hdpath}}/move" 13 | chmod -R 755 "{{hdpath}}/move" 14 | 15 | mergerfs -o func.getattr=newest,category.create=ff,direct_io,use_ino,atomic_o_trunc,big_writes,default_permissions,splice_move,splice_read,splice_write,allow_other,sync_read,minfreespace=15,umask=002,uid=1000,gid=1000,fsname=pgunity,nonempty \ 16 | {{hdpath}}/move=RO:{{hdpath}}/downloads=RW:{{multihds}} /pg/unity 17 | -------------------------------------------------------------------------------- /source/loop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | admin9705="9705" 9 | sleep 2 10 | 11 | echo "" > /pg/logs/transfer.log 12 | echo "" >> /pg/logs/transfer.log 13 | echo "----------------------------" >> /pg/logs/transfer.log 14 | echo "PGBlitz Log - First Startup" >> /pg/logs/transfer.log 15 | rm -rf /pg/logs/.transfer_list 16 | rm -rf /pg/logs/.temp_list 17 | 18 | var1=$(cat /pg/rclone/deployed.version) 19 | if [[ "$var1" == "gd" ]]; then var2="GDrive Unencrypted" 20 | elif [[ "$var1" == "gc" ]]; then var2="GDrive Encrypted" 21 | elif [[ "$var1" == "sd" ]]; then var2="SDrive Unencrypted" 22 | elif [[ "$var1" == "sc" ]]; then var2="SDrive Encrypted"; fi 23 | 24 | if [[ "$var1" == "sd" || "$var1" == "sc" ]]; then 25 | blitzcount=$(wc -l /pg/var/.blitzlist | awk '{print $1}') 26 | keyloop=0 27 | fi 28 | 29 | while [[ "$admin9705" == "9705" ]]; do 30 | 31 | let cyclecount++ 32 | echo "--------------------------------------------------------" >> /pg/logs/transfer.log 33 | echo "PG Blitz Log - Cycle $cyclecount - $var2" >> /pg/logs/transfer.log 34 | 35 | if [[ "$var1" == "sd" || "$var1" == "sc" ]]; then 36 | let keyloop++ 37 | echo "$keyloop" > /pg/rclone/keyloop 38 | currentkey=$(sed -n "${keyloop}p" /pg/var/.blitzlist) 39 | echo "$currentkey" > /pg/rclone/currentkey 40 | echo "Shared Key - $currentkey" >> /pg/logs/transfer.log 41 | if [[ "$keyloop" -ge "$blitzcount" ]]; then keyloop=0; fi 42 | fi 43 | 44 | echo "" >> /pg/logs/transfer.log 45 | bash /pg/rclone/transfer.sh 46 | 47 | # cat /pg/logs/transfer.log | tail -200 > /pg/logs/transfer.log 48 | echo "" >> /pg/logs/transfer.log 49 | echo "Cycle $cyclecount Complete - Sleeping 5 Seconds" >> /pg/logs/transfer.log 50 | echo "" >> /pg/logs/transfer.log 51 | sleep 2 52 | primepath="$(cat /pg/var/hd.path)" 53 | find "$primepath/transfer" -mindepth 1 -type d -mmin +1 -empty -delete 54 | 55 | done 56 | -------------------------------------------------------------------------------- /source/pgblitz.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors & PhysK 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | 9 | # Starting Actions 10 | touch /pg/logs/pgblitz.log 11 | 12 | echo "" >> /pg/logs/pgblitz.log 13 | echo "" >> /pg/logs/pgblitz.log 14 | echo "----------------------------" >> /pg/logs/pgblitz.log 15 | echo "PG Blitz Log - First Startup" >> /pg/logs/pgblitz.log 16 | chown -R 1000:1000 "{{hdpath}}/downloads" 17 | chmod -R 775 "{{hdpath}}/downloads" 18 | chown -R 1000:1000 "{{hdpath}}/move" 19 | chmod -R 775 "{{hdpath}}/move" 20 | 21 | startscript () { 22 | while read p; do 23 | 24 | # Repull excluded folder 25 | wget -qN https://raw.githubusercontent.com/PGBlitz/PGClone/v8.6/functions/exclude -P /pg/var/ 26 | 27 | cleaner="$(cat /pg/var/cloneclean)" 28 | useragent="$(cat /pg/var/uagent)" 29 | 30 | let "cyclecount++" 31 | echo "----------------------------" >> /pg/logs/pgblitz.log 32 | echo "PG Blitz Log - Cycle $cyclecount" >> /pg/logs/pgblitz.log 33 | echo "" >> /pg/logs/pgblitz.log 34 | echo "Utilizing: $p" >> /pg/logs/pgblitz.log 35 | 36 | rclone moveto "{{hdpath}}/downloads/" "{{hdpath}}/transfer/" \ 37 | --config /pg/rclone/blitz.conf \ 38 | --log-file=/pg/logs/pgblitz.log \ 39 | --log-level ERROR --stats 5s --stats-file-name-length 0 \ 40 | --exclude="**_HIDDEN~" --exclude=".unionfs/**" \ 41 | --exclude="**partial~" --exclude=".unionfs-fuse/**" \ 42 | --exclude=".fuse_hidden**" --exclude="**.grab/**" \ 43 | --exclude="**sabnzbd**" --exclude="**nzbget**" \ 44 | --exclude="**qbittorrent**" --exclude="**rutorrent**" \ 45 | --exclude="**deluge**" --exclude="**transmission**" \ 46 | --exclude="**jdownloader**" --exclude="**makemkv**" \ 47 | --exclude="**handbrake**" --exclude="**bazarr**" \ 48 | --exclude="**ignore**" --exclude="**inProgress**" 49 | 50 | chown -R 1000:1000 "{{hdpath}}/move" 51 | chmod -R 775 "{{hdpath}}/move" 52 | 53 | rclone moveto "{{hdpath}}/move" "${p}{{encryptbit}}:/" \ 54 | --config /pg/rclone/blitz.conf \ 55 | --log-file=/pg/logs/pgblitz.log \ 56 | --log-level INFO --stats 5s --stats-file-name-length 0 \ 57 | --tpslimit 12 \ 58 | --checkers=20 \ 59 | --transfers=16 \ 60 | --bwlimit {{bandwidth.stdout}}M \ 61 | --user-agent="$useragent" \ 62 | --drive-chunk-size={{dcs}} \ 63 | --exclude="**_HIDDEN~" --exclude=".unionfs/**" \ 64 | --exclude="**partial~" --exclude=".unionfs-fuse/**" \ 65 | --exclude=".fuse_hidden**" --exclude="**.grab/**" \ 66 | --exclude="**sabnzbd**" --exclude="**nzbget**" \ 67 | --exclude="**qbittorrent**" --exclude="**rutorrent**" \ 68 | --exclude="**deluge**" --exclude="**transmission**" \ 69 | --exclude="**jdownloader**" --exclude="**makemkv**" \ 70 | --exclude="**handbrake**" --exclude="**bazarr**" \ 71 | --exclude="**ignore**" --exclude="**inProgress**" 72 | 73 | echo "Cycle $cyclecount - Sleeping for 30 Seconds" >> /pg/logs/pgblitz.log 74 | cat /pg/logs/pgblitz.log | tail -200 > /pg/logs/pgblitz.log 75 | #sed -i -e "/Duplicate directory found in destination/d" /pg/logs/pgblitz.log 76 | sleep 30 77 | 78 | #Quick fix 79 | # Remove empty directories 80 | #find "$dlpath/downloads/" -mindepth 2 -type d -empty -exec rm -rf {} \; 81 | #find "$dlpath/move/" -type d -empty -exec rm -rf {} \; 82 | #find "$dlpath/move/" -mindepth 2 -type f -cmin +5 -size +1M -exec rm -rf {} \; 83 | 84 | # Remove empty directories 85 | find "{{hdpath}}/transfer/" -mindepth 2 -type d -mmin +2 -empty -exec rm -rf {} \; 86 | 87 | # Removes garbage | torrent folder excluded 88 | find "{{hdpath}}/downloads" -mindepth 2 -type d -cmin +$cleaner $(printf "! -name %s " $(cat /pg/var/exclude)) -empty -exec rm -rf {} \; 89 | find "{{hdpath}}/downloads" -mindepth 2 -type f -cmin +$cleaner $(printf "! -name %s " $(cat /pg/var/exclude)) -size +1M -exec rm -rf {} \; 90 | 91 | done > /pg/logs/transfer.log 13 | chmod 775 -R {{hdpath}}/transfer/ 14 | chown -R 1000:1000 {{hdpath}}/transfer/ 15 | 16 | touch /pg/logs/transfer.log 17 | touch /pg/logs/.transfer_list 18 | touch /pg/logs/.temp_list 19 | 20 | basicpath="$(cat /pg/var/server.hd.path)" 21 | useragent="$(cat /pg/var/uagent)" 22 | bwg="$(cat /pg/var/move.bw)" 23 | bws="$(cat /pg/var/blitz.bw)" 24 | 25 | var3=$(cat /pg/rclone/deployed.version) 26 | if [[ "$var3" == "gd" ]]; then var4="gdrive" 27 | elif [[ "$var3" == "gc" ]]; then var4="gdrive" 28 | elif [[ "$var3" == "sd" ]]; then var4="sdrive" 29 | elif [[ "$var3" == "sd" ]]; then var4="sdrive"; fi 30 | 31 | filecount=$(wc -l /pg/logs/.transfer_list | awk '{print $1}') 32 | echo "$filecount" > /pg/var/filecount 33 | 34 | if [[ "$filecount" -gt 8 ]]; then 35 | echo "Max Files of [8] Files - Pending Transfer" >> /pg/logs/transfer.log 36 | echo "Exiting Cycle" >> /pg/logs/transfer.log 37 | exit; fi 38 | 39 | find /pg/transfer/ -type f > /pg/logs/.temp_list 40 | 41 | while read p; do 42 | sed -i "/^$p\b/Id" /pg/logs/.temp_list 43 | done > /pg/logs/.transfer_list 46 | uploadfile=$(head -n +1 /pg/logs/.temp_list) 47 | 48 | if [[ "$uploadfile" == "" ]]; then 49 | echo "Nothing To Upload" >> /pg/logs/transfer.log 50 | exit; fi 51 | 52 | chown 1000:1000 "$uploadfile" 53 | chmod 775 "$uploadfile" 54 | 55 | totalchar=$(echo "${basicpath}" | awk -F"/" '{print NF-1}') 56 | finalcount=$((totalchar + 3)) 57 | 58 | echo "Preparing to Upload: $uploadfile" >> /pg/logs/transfer.log 59 | truepath=$(echo $uploadfile | cut -d'/' -f${finalcount}-) 60 | 61 | if [[ "$var4" == "gdrive" ]]; then 62 | echo "Started Upload - $var3: $uploadfile" >> /pg/logs/transfer.log 63 | udrive=$(cat /pg/rclone/deployed.version) 64 | 65 | rclone move "$uploadfile" "$udrive:/$truepath" \ 66 | --config /pg/rclone/blitz.conf \ 67 | --log-file=/pg/logs/transfer.log \ 68 | --log-level INFO --stats 5s --stats-file-name-length 0 \ 69 | --tpslimit 6 \ 70 | --checkers=20 \ 71 | --min-age=30s \ 72 | --bwlimit="$bwg"M \ 73 | --user-agent="$useragent" \ 74 | --drive-chunk-size={{dcs}} \ 75 | --exclude="**_HIDDEN~" --exclude="*partial~" \ 76 | --exclude=".fuse_hidden**" --exclude="**.grab/**" 77 | else 78 | echo "Started Shared Upload - $var3: $uploadfile" >> /pg/logs/transfer.log 79 | readykey=$(cat /pg/rclone/currentkey) 80 | uread=$(cat /pg/rclone/deployed.version) 81 | encryptbit="" 82 | if [[ "$uread" == "sc" ]]; then encryptbit="C"; fi 83 | 84 | rclone move "$uploadfile" "${readykey}${encryptbit}:/$truepath" \ 85 | --config /pg/rclone/blitz.conf \ 86 | --log-file=/pg/logs/pgblitz.log \ 87 | --log-level INFO --stats 5s --stats-file-name-length 0 \ 88 | --tpslimit 12 \ 89 | --checkers=20 \ 90 | --min-age=30s \ 91 | --transfers=16 \ 92 | --bwlimit="$bws"M \ 93 | --user-agent="$useragent" \ 94 | --drive-chunk-size={{dcs}} \ 95 | --exclude="**_HIDDEN~" --exclude=".unionfs/**" \ 96 | --exclude="**partial~" --exclude=".unionfs-fuse/**" \ 97 | --exclude=".fuse_hidden**" --exclude="**.grab/**" 98 | fi 99 | 100 | grep -v "$uploadfile" "/pg/logs/.transfer_list" | sponge "/pg/logs/.transfer_list" 101 | exit 102 | -------------------------------------------------------------------------------- /templates/edit-gc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors & Deiteq 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | nano /etc/systemd/system/gc.service && systemctl daemon-reload 9 | -------------------------------------------------------------------------------- /templates/edit-gd: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors & Deiteq 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | nano /etc/systemd/system/gd.service && ssystemctl daemon-reload 9 | -------------------------------------------------------------------------------- /templates/edit-pgunity: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors & Deiteq 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | nano /pg/rclone/pgunity.sh && systemctl daemon-reload 9 | -------------------------------------------------------------------------------- /templates/edit-rclone: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors & Deiteq 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | sudo nano /pg/rclone/blitz.conf && sudo systemctl daemon-reload 9 | -------------------------------------------------------------------------------- /templates/edit-sc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors & Deiteq 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | nano /etc/systemd/system/sc.serivce && systemctl daemon-reload 9 | -------------------------------------------------------------------------------- /templates/edit-sd: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors & Deiteq 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | nano /etc/systemd/system/sd.service && systemctl daemon-reload 9 | -------------------------------------------------------------------------------- /templates/edit-transport: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors & Deiteq 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | nano /pg/rclone/transfer.sh && systemctl daemon-reload 9 | -------------------------------------------------------------------------------- /templates/status-gc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors & Deiteq 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | sudo systemctl status gc 9 | -------------------------------------------------------------------------------- /templates/status-gd: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors & Deiteq 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | sudo systemctl status gd 9 | -------------------------------------------------------------------------------- /templates/status-pgblitz: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors & Deiteq 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | sudo systemctl status pgblitz 9 | -------------------------------------------------------------------------------- /templates/status-pgunity: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors & Deiteq 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | sudo systemctl status pgunity 9 | -------------------------------------------------------------------------------- /templates/status-rclone: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors & Deiteq 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | tail -15 /pg/logs/rclone*.log 9 | -------------------------------------------------------------------------------- /templates/status-sc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors & Deiteq 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | sudo systemctl status sc 9 | -------------------------------------------------------------------------------- /templates/status-sd: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors & Deiteq 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | sudo systemctl status sd 9 | -------------------------------------------------------------------------------- /templates/status-transport: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors & Deiteq 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | sudo systemctl status transport 9 | -------------------------------------------------------------------------------- /ymls/alias.yml: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors - Deiteq 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | --- 9 | - name: Removing Old Service Helpers 10 | file: 11 | path: "/bin/{{item}}" 12 | state: absent 13 | with_items: 14 | - edit-gc 15 | - edit-gd 16 | - edit-transport 17 | - edit-pgunity 18 | - edit-rclone 19 | - edit-sc 20 | - edit-sd 21 | - status-transport 22 | - status-gc 23 | - status-gd 24 | - status-pgunity 25 | - status-rclone 26 | - status-gc 27 | - status-sd 28 | 29 | - name: Installing Service helpers 30 | template: 31 | src: "/pg/pgclone/templates/{{item}}" 32 | dest: /bin/{{item}} 33 | force: yes 34 | mode: 0775 35 | with_items: 36 | - edit-gc 37 | - edit-gd 38 | - edit-transport 39 | - edit-pgunity 40 | - edit-rclone 41 | - edit-sc 42 | - edit-sd 43 | - status-transport 44 | - status-gc 45 | - status-gd 46 | - status-pgunity 47 | - status-rclone 48 | - status-gc 49 | - status-sd 50 | -------------------------------------------------------------------------------- /ymls/crypt.yml: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors - Deiteq 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | --- 9 | - hosts: localhost 10 | gather_facts: false 11 | tasks: 12 | 13 | - name: "Creating Folder - /pg/{{drive}}" 14 | file: 'path={{item}} state=directory mode=0775 owner=1000 group=1000' 15 | with_items: 16 | - "/pg/{{drive}}" 17 | 18 | - name: Register Agent 19 | shell: 'cat /pg/var/uagent' 20 | register: uagent 21 | 22 | - name: "Install - Service {{drive}}" 23 | template: 24 | src: "/pg/pgclone/mounts/crypt.service" 25 | dest: "/etc/systemd/system/{{drive}}.service" 26 | force: yes 27 | ignore_errors: yes 28 | 29 | - name: "Reload Service - {{drive}}" 30 | systemd: 31 | daemon_reload: yes 32 | enabled: yes 33 | state: reloaded 34 | name: "{{drive}}" 35 | -------------------------------------------------------------------------------- /ymls/local.yml: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors - Deiteq 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | --- 9 | - hosts: localhost 10 | gather_facts: false 11 | tasks: 12 | - name: include PGClone aliases 13 | include_tasks: '/pg/pgclone/ymls/alias.yml' 14 | 15 | - debug: msg="Combined Path - {{multihds}}" 16 | 17 | - name: Install Union Script 18 | template: 19 | src: /pg/pgclone/source/local.sh 20 | dest: /pg/rclone/pgunity.sh 21 | force: yes 22 | 23 | - name: Install PGUnity Service 24 | template: 25 | src: /pg/pgclone/mounts/pgunity.service 26 | dest: /etc/systemd/system/pgunity.service 27 | force: yes 28 | 29 | - name: Reload PGUnity Service 30 | systemd: 31 | daemon_reload: yes 32 | enabled: yes 33 | state: reloaded 34 | name: pgunity 35 | 36 | - name: Sleep 2 Seconds 37 | wait_for: timeout=2 38 | 39 | - name: Restart All Docker Containers 40 | shell: docker restart $(docker ps -a -q) 41 | -------------------------------------------------------------------------------- /ymls/mount.yml: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors - Deiteq 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | --- 9 | - hosts: localhost 10 | gather_facts: false 11 | tasks: 12 | 13 | - name: "Creating Folder - /pg/{{drive}}" 14 | file: 'path={{item}} state=directory mode=0775 owner=1000 group=1000' 15 | with_items: 16 | - "/pg/{{drive}}" 17 | 18 | - name: Register Agent 19 | shell: 'cat /pg/var/uagent' 20 | register: uagent 21 | 22 | - name: "Install - Service {{drive}}" 23 | template: 24 | src: "/pg/pgclone/mounts/drive.service" 25 | dest: "/etc/systemd/system/{{drive}}.service" 26 | force: yes 27 | ignore_errors: yes 28 | 29 | - name: "Reload Service - {{drive}}" 30 | systemd: 31 | daemon_reload: yes 32 | enabled: yes 33 | state: reloaded 34 | name: "{{drive}}" 35 | -------------------------------------------------------------------------------- /ymls/pgunity.yml: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors - Deiteq 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | --- 9 | - hosts: localhost 10 | gather_facts: false 11 | tasks: 12 | - name: include PGClone aliases 13 | include_tasks: '/pg/pgclone/ymls/alias.yml' 14 | 15 | - debug: msg="PGBlitz Type - {{transport}}" 16 | - debug: msg="HD Path - {{hdpath}}" 17 | 18 | - name: 'If Fact Matches - SDrive Encrypted' 19 | set_fact: 20 | path: 'remotes = gd: sd: gc: sc: {{hdpath}}/move' 21 | when: transport == "sc" 22 | 23 | - name: 'If Fact Matches - GDrive Encrypted' 24 | set_fact: 25 | path: 'remotes = gd: gc: {{hdpath}}/move' 26 | when: transport == "gc" 27 | 28 | - name: 'If Fact Matches - SDrive Unencrypted' 29 | set_fact: 30 | path: 'remotes = gd: sd: {{hdpath}}/move' 31 | when: transport == "sd" 32 | 33 | - name: 'If Fact Matches - GDrive Unencrypted' 34 | set_fact: 35 | path: 'remotes = gd: {{hdpath}}/move' 36 | when: transport == "gd" 37 | 38 | - name: Creating required paths 39 | file: 'path={{hdpath}}/{{item}} state=directory mode=0775 owner=1000 group=1000 recurse=true' 40 | with_items: 41 | - 'move' 42 | - 'downloads' 43 | - 'incomplete' 44 | 45 | - name: Creating Logs Path 46 | file: 'path=/pg/{{item}} state=directory mode=0775 owner=1000 group=1000 recurse=true' 47 | with_items: 48 | - 'logs' 49 | 50 | - name: 'Setting ownership on logs' 51 | shell: 'chown -R 1000:1000 /pg/logs' 52 | 53 | - name: 'Setting ownership' 54 | shell: 'chown -R 1000:1000 {{hdpath}}/{{item}}' 55 | with_items: 56 | - 'move' 57 | - 'downloads' 58 | - 'incomplete' 59 | 60 | - name: 'Setting permissions' 61 | shell: 'chmod -R 775 {{hdpath}}/{{item}}' 62 | with_items: 63 | - 'move' 64 | - 'downloads' 65 | - 'incomplete' 66 | 67 | - name: Transport Type 68 | shell: 'echo "" >> /pg/rclone/blitz.conf' 69 | 70 | - name: Line Rmur 71 | shell: 'sed -i -e "/\[(unionfs|pgunity)\]/,+2d" /pg/rclone/blitz.conf' 72 | 73 | - name: Transport Type 74 | shell: | 75 | echo "[pgunity]" >> /pg/rclone/blitz.conf 76 | echo "type = union" >> /pg/rclone/blitz.conf 77 | echo "{{path}}" >> /pg/rclone/blitz.conf 78 | 79 | - name: 'PG Blitz Execution' 80 | block: 81 | 82 | - name: Bandwidth Limit 83 | shell: 'cat /pg/var/blitz.bw' 84 | register: bandwidth 85 | 86 | - name: Install Transfer Script 87 | template: 88 | src: /pg/pgclone/source/transfer.sh 89 | dest: /pg/rclone/transfer.sh 90 | force: yes 91 | 92 | - name: Install Loop Script 93 | template: 94 | src: /pg/pgclone/source/loop.sh 95 | dest: /pg/rclone/loop.sh 96 | force: yes 97 | 98 | - name: Install Transfer Service 99 | template: 100 | src: /pg/pgclone/mounts/transfer.service 101 | dest: /etc/systemd/system/transfer.service 102 | force: yes 103 | 104 | - name: Reload Transfer Service 105 | systemd: 106 | daemon_reload: yes 107 | enabled: yes 108 | state: reloaded 109 | name: transfer 110 | 111 | when: (transport == "gd") or 112 | (transport == "gc") 113 | 114 | - name: 'PG Move Execution' 115 | block: 116 | - name: Bandwidth Limit 117 | shell: 'cat /pg/var/move.bw' 118 | register: bandwidth 119 | 120 | - name: Deploy Version 121 | shell: 'cat /pg/rclone/deploy.version' 122 | register: ver 123 | 124 | - name: Register HD Path 125 | shell: 'cat /pg/var/server.hd.path' 126 | register: hdpath 127 | 128 | - name: Install Transfer Script 129 | template: 130 | src: /pg/pgclone/source/transfer.sh 131 | dest: /pg/rclone/transfer.sh 132 | force: yes 133 | 134 | - name: Install Loop Script 135 | template: 136 | src: /pg/pgclone/source/loop.sh 137 | dest: /pg/rclone/loop.sh 138 | force: yes 139 | 140 | - name: Install Transfer Service 141 | template: 142 | src: /pg/pgclone/mounts/transfer.service 143 | dest: /etc/systemd/system/transfer.service 144 | force: yes 145 | 146 | - name: Reload Transfer Service 147 | systemd: 148 | daemon_reload: yes 149 | enabled: yes 150 | state: reloaded 151 | name: transfer 152 | 153 | when: (transport == "sc") or 154 | (transport == "sd") 155 | 156 | - name: Install PGUnity Script 157 | template: 158 | src: /pg/pgclone/source/pgunity.sh 159 | dest: /pg/rclone/pgunity.sh 160 | force: yes 161 | 162 | - name: Install PGUnity Service 163 | template: 164 | src: /pg/pgclone/mounts/pgunity.service 165 | dest: /etc/systemd/system/pgunity.service 166 | force: yes 167 | 168 | - name: Reload PGUnity Service 169 | systemd: 170 | daemon_reload: yes 171 | enabled: yes 172 | state: reloaded 173 | name: pgunity 174 | 175 | - name: 'Waiting for PGUnity to initialize' 176 | wait_for: 177 | path: /pg/unity/plexguide 178 | timeout: 15 179 | delay: 2 180 | 181 | - name: Register HD Path 182 | shell: 'cat /pg/var/server.hd.path' 183 | register: hdpath 184 | 185 | - name: Restart All Docker Containers 186 | shell: docker restart $(docker ps -a -q) 187 | -------------------------------------------------------------------------------- /ymls/remove.yml: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Title: Reference Title File - PGBlitz 4 | # Author(s): Admin9705 & https://github.com/PGBlitz/PGClone/graphs/contributors - Deiteq 5 | # URL: https://pgblitz.com - http://github.pgblitz.com 6 | # GNU: General Public License v3.0 7 | ################################################################################ 8 | --- 9 | - hosts: localhost 10 | gather_facts: false 11 | vars: 12 | service_vars: 13 | - {name: crypt.service} 14 | - {name: gd.service} 15 | - {name: gc.service} 16 | - {name: sd.service} 17 | - {name: sc.service} 18 | - {name: pgunity.service} 19 | - {name: transfer.service} 20 | tasks: 21 | - name: Stop All Docker Containers 22 | shell: docker stop $(docker ps -a -q) 23 | ignore_errors: yes 24 | 25 | - name: Checking Existing Service Name 26 | stat: 27 | path: "/etc/systemd/system/{{ item.name }}" 28 | with_items: "{{ service_vars }}" 29 | register: check_service_name 30 | 31 | - name: Stop If Service Is Running 32 | systemd: state=stopped name={{ item.item.name }} daemon_reload=yes enabled=no 33 | with_items: "{{ check_service_name.results }}" 34 | when: item.stat.exists 35 | 36 | - name: Remove Services 37 | file: 38 | path: "/etc/systemd/system/{{ item.item.name }}" 39 | state: absent 40 | with_items: "{{ check_service_name.results }}" 41 | when: item.stat.exists 42 | --------------------------------------------------------------------------------