mirror of https://github.com/tteck/Proxmox.git
				
				
				
			feat(scripts): cronjob
This commit is contained in:
		
							parent
							
								
									402ebdf0fd
								
							
						
					
					
						commit
						239059be48
					
				| 
						 | 
					@ -48,46 +48,15 @@ function default_settings() {
 | 
				
			||||||
  MAC=""
 | 
					  MAC=""
 | 
				
			||||||
  VLAN=""
 | 
					  VLAN=""
 | 
				
			||||||
  SSH="no"
 | 
					  SSH="no"
 | 
				
			||||||
  VERB="yes"
 | 
					  VERB="no"
 | 
				
			||||||
  echo_default
 | 
					  echo_default
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function setup_services(){
 | 
					 | 
				
			||||||
  msg_info "Initializing gaming services to claim games for"
 | 
					 | 
				
			||||||
  CHOICES=$(whiptail --title "Select game services" --separate-output --checklist "Select services" 20 78 4 "EPIC" "Epic Games" OFF "GOG" "Good Old Games" OFF 3>&1 1>&2 2>&3)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  echo $CHOICES
 | 
					 | 
				
			||||||
  if [ ! -z "$CHOICES" ]; then
 | 
					 | 
				
			||||||
      for CHOICE in $CHOICES; do
 | 
					 | 
				
			||||||
        case $CHOICE in
 | 
					 | 
				
			||||||
        "EPIC")
 | 
					 | 
				
			||||||
          $STD node epic-games
 | 
					 | 
				
			||||||
          ;;
 | 
					 | 
				
			||||||
        "GOG")
 | 
					 | 
				
			||||||
          $STD node gog
 | 
					 | 
				
			||||||
          ;;
 | 
					 | 
				
			||||||
        *)
 | 
					 | 
				
			||||||
          echo "Unsupported item $CHOICE!" >&2
 | 
					 | 
				
			||||||
          exit 1
 | 
					 | 
				
			||||||
          ;;
 | 
					 | 
				
			||||||
        esac
 | 
					 | 
				
			||||||
      done
 | 
					 | 
				
			||||||
    fi
 | 
					 | 
				
			||||||
  msg_ok "Services initialized: ${CHOICES}"
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
function update_script() {
 | 
					function update_script() {
 | 
				
			||||||
  header_info
 | 
					  header_info
 | 
				
			||||||
  if [[ ! -d /opt/freegamesclaimer ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
 | 
					  if [[ ! -d /opt/freegamesclaimer ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
 | 
				
			||||||
  msg_info "Updating $APP"
 | 
					  msg_info "Updating $APP"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "UPDATE \ Setup service" --radiolist --cancel-button Exit-Script "Spacebar = Select" 11 58 4 \
 | 
					 | 
				
			||||||
      "1" "Update" ON \
 | 
					 | 
				
			||||||
      "2" "Setup a service" OFF \
 | 
					 | 
				
			||||||
      3>&1 1>&2 2>&3)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  case $CHOICE in
 | 
					 | 
				
			||||||
  "1")
 | 
					 | 
				
			||||||
  cd /opt/freegamesclaimer || exit
 | 
					  cd /opt/freegamesclaimer || exit
 | 
				
			||||||
  output=$(git pull)
 | 
					  output=$(git pull)
 | 
				
			||||||
  git pull &>/dev/null
 | 
					  git pull &>/dev/null
 | 
				
			||||||
| 
						 | 
					@ -100,15 +69,6 @@ function update_script() {
 | 
				
			||||||
  $STD npm install
 | 
					  $STD npm install
 | 
				
			||||||
  $STD npx playwright install firefox --with-deps
 | 
					  $STD npx playwright install firefox --with-deps
 | 
				
			||||||
  msg_ok "Updated $APP - If needed, run update again to setup the gaming services"
 | 
					  msg_ok "Updated $APP - If needed, run update again to setup the gaming services"
 | 
				
			||||||
    ;;
 | 
					 | 
				
			||||||
  "2")
 | 
					 | 
				
			||||||
    setup_services
 | 
					 | 
				
			||||||
    ;;
 | 
					 | 
				
			||||||
  *)
 | 
					 | 
				
			||||||
    echo "Unsupported item $CHOICE!" >&2
 | 
					 | 
				
			||||||
    exit 1
 | 
					 | 
				
			||||||
    ;;
 | 
					 | 
				
			||||||
  esac
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
start
 | 
					start
 | 
				
			||||||
| 
						 | 
					@ -116,4 +76,5 @@ build_container
 | 
				
			||||||
description
 | 
					description
 | 
				
			||||||
 | 
					
 | 
				
			||||||
msg_ok "Completed Successfully!\n"
 | 
					msg_ok "Completed Successfully!\n"
 | 
				
			||||||
echo -e "${APP} installed"
 | 
					echo -e "${APP} has been setup to claim GOG and Epic games. \n
 | 
				
			||||||
 | 
					         Make sure to run an initial login for the cookies to be set  \n"
 | 
				
			||||||
| 
						 | 
					@ -91,8 +91,3 @@ msg_info "Cleaning up"
 | 
				
			||||||
$STD apt-get -y autoremove
 | 
					$STD apt-get -y autoremove
 | 
				
			||||||
$STD apt-get -y autoclean
 | 
					$STD apt-get -y autoclean
 | 
				
			||||||
msg_ok "Cleaned"
 | 
					msg_ok "Cleaned"
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
msg_ok "Completed Successfully!\n"
 | 
					 | 
				
			||||||
echo -e "${APP} has been setup to claim GOG and Epic games. \n
 | 
					 | 
				
			||||||
         Please add your credentials to /opt/freegamesclaimer/data/config.env \n"
 | 
					 | 
				
			||||||
		Loading…
	
		Reference in New Issue