2022-07-25 02:29:58 +00:00
#!/bin/bash
sync( ) {
2022-07-27 16:03:34 +00:00
echo_sync += ( "\n\nSync Output" )
2022-07-26 23:53:08 +00:00
echo_sync += ( "-----------" )
2022-07-26 23:43:06 +00:00
cli -c 'app catalog sync_all' & > /dev/null && echo_sync += ( "Catalog sync complete" )
2022-07-26 06:32:37 +00:00
#Dump the echo_array, ensures all output is in a neat order.
for i in " ${ echo_sync [@] } "
do
echo -e " $i "
done
2022-07-25 02:29:58 +00:00
}
export -f sync
prune( ) {
2022-07-27 16:03:34 +00:00
echo -e "\n\nDocker Prune Output"
2022-07-26 23:53:08 +00:00
echo "-------------------"
echo "Pruned Docker Images"
docker image prune -af | grep "^Total" || echo "Failed to Prune Docker Images"
2022-07-25 02:29:58 +00:00
}
export -f prune
title( ) {
echo ' _ _ _____ _ _ '
echo '| | | | / ___| (_) | | '
echo '| |_| | ___ __ ___ ___ _\ `--. ___ _ __ _ _ __ | |_'
echo "| _ |/ _ \/ _\` \ \ / / | | |\`--. \/ __| '__| | '_ \| __|"
echo '| | | | __/ (_| |\ V /| |_| /\__/ / (__| | | | |_) | |_ '
echo '\_| |_/\___|\__,_| \_/ \__, \____/ \___|_| |_| .__/ \__|'
echo ' __/ | | | '
echo ' |___/ |_| '
echo
}
export -f title
help( ) {
[ [ $help = = "true" ] ] && clear -x
2022-07-27 02:34:18 +00:00
echo "Access the HeavyScript Menu"
echo "---------------------------"
echo "(Just dont send any other argument)"
echo "bash heavy_script.sh"
echo
2022-07-25 02:29:58 +00:00
echo "Basic Utilities"
2022-07-27 02:34:18 +00:00
echo "---------------"
2022-07-25 02:29:58 +00:00
echo "--mount | Initiates mounting feature, choose between unmounting and mounting PVC data"
echo "--restore | Opens a menu to restore a \"heavy_script\" backup that was taken on your \"ix-applications\" dataset"
echo "--delete-backup | Opens a menu to delete backups on your system"
echo "--dns | list all of your applications DNS names and their web ports"
echo
echo "Update Options"
2022-07-27 02:34:18 +00:00
echo "--------------"
2022-07-27 02:38:18 +00:00
echo "-U | Update all applications, ignores versions"
echo "-U 5 | Same as above, but updates 5 applications at one time"
echo "-u | Update all applications, does not update Major releases"
echo "-u 5 | Same as above, but updates 5 applications at one time"
2022-07-27 02:31:44 +00:00
echo
2022-07-27 02:36:18 +00:00
echo "Additional Update Options"
echo "-------------------------"
2022-07-27 02:38:18 +00:00
echo "-b 14 | Back-up your ix-applications dataset, specify a number after -b"
echo "-i | Add application to ignore list, one by one, see example below."
echo "-r | Roll-back applications if they fail to update"
echo "-S | Shutdown applications prior to updating"
echo "-v | verbose output"
echo "-t 500| Set a custom timeout in seconds when checking if either an App or Mountpoint correctly Started, Stopped or (un)Mounted. Defaults to 500 seconds"
echo "-s | sync catalog"
echo "-p | Prune unused/old docker images"
2022-07-25 02:29:58 +00:00
echo
echo "Examples"
2022-07-27 02:34:18 +00:00
echo "--------"
2022-07-27 02:38:18 +00:00
echo "bash heavy_script.sh"
echo "bash heavy_script.sh -b 14 -i portainer -i arch -i sonarr -t 600 -vrsUp"
echo "bash heavy_script.sh -b 14 -i portainer -i arch -i sonarr -t 600 -vrsp -U 10"
2022-07-25 02:29:58 +00:00
echo "bash /mnt/tank/scripts/heavy_script.sh -t 150 --mount"
echo "bash /mnt/tank/scripts/heavy_script.sh --dns"
echo "bash heavy_script.sh --restore"
echo "bash /mnt/tank/scripts/heavy_script.sh --delete-backup"
echo
exit
}
export -f help