Compare commits
	
		
			14 Commits
		
	
	
		
			8a8845d898
			...
			dev
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| f8d2e3ea08 | |||
| 6a367bebec | |||
| 219236f167 | |||
| 2feb3e88cc | |||
| a1a02500e4 | |||
| 5d9f57fec4 | |||
| 30a8041fa8 | |||
| ff1cf74a00 | |||
| 5ad44a8056 | |||
| b5ea457491 | |||
| eaf8d2e0bb | |||
| 616663ffe0 | |||
| 1cd182b3a9 | |||
| ccd4f4d051 | 
| @@ -25,7 +25,9 @@ function kill-project { | ||||
| } | ||||
| 
 | ||||
| function reload-project { | ||||
| 	# Nothing to do, run.sh and main.js automatically uses the latest files. | ||||
| 	# Not much to do, run.sh and main.js automatically uses the latest files. | ||||
| 	rm -v files/photos/index.html | ||||
| 	# TBD/TODO: Call check_photos.sh once it has been pulled from run.sh. | ||||
| 	log "Project reloaded successfully!" | ||||
| } | ||||
| 
 | ||||
							
								
								
									
										46
									
								
								check_photos.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										46
									
								
								check_photos.sh
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,46 @@ | ||||
| #!/usr/bin/env bash | ||||
| # 2025-10-15 Hyperling | ||||
| # Create script which does the photo checking so that it can be called by | ||||
| #  scripts other than just run.sh, such as if it needs used in check_git.sh. | ||||
|  | ||||
| ## Setup ## | ||||
|  | ||||
| DIR="$(dirname -- "${BASH_SOURCE[0]}")" | ||||
| PROG="$(basename -- "${BASH_SOURCE[0]}")" | ||||
| cd $DIR | ||||
| DIR="`pwd`" | ||||
| NAME="'$PROG'" | ||||
|  | ||||
| function log { | ||||
| 	echo -e "`date` : $NAME - $1" | ||||
| } | ||||
|  | ||||
| ## Parameters ## | ||||
|  | ||||
| ports="$1" | ||||
|  | ||||
| ## Main ## | ||||
|  | ||||
| count=1 | ||||
| http_code=0 | ||||
| port="${ports%% *}" | ||||
| photos_uri=":$port/photos/" | ||||
| beg_time="$SECONDS" | ||||
| while [[ $http_code != "200" ]]; do | ||||
|    log "Sleeping for '$count' while waiting for $photos_uri to come up." | ||||
|    sleep $count | ||||
|    log "Checking if $photos_uri is available." | ||||
|    http_code="`curl --silent --fail -w '\n%{http_code}' localhost$photos_uri | tail -n 1`" | ||||
|    log "Check for $photos_uri responded with '$http_code'." | ||||
|    if (( $count >= 10 )); then | ||||
|       log "Giving up on loading $photos_uri after '$count' attempts." | ||||
|       break | ||||
|    else | ||||
|       count=$(( count + 1 )) | ||||
|    fi | ||||
| done | ||||
| end_time="$SECONDS" | ||||
| time="$(( $end_time - $beg_time ))" | ||||
| log "Finished checking for /photos/ after '$time' seconds." | ||||
|  | ||||
| exit 0 | ||||
| @@ -1,8 +1,6 @@ | ||||
| #!/usr/bin/php | ||||
| <!-- | ||||
| 	Synonym for home page. | ||||
| --> | ||||
| <?php | ||||
| 	/* Synonym for home page. */ | ||||
| 	if (!isset($GLOBALS["HEADER_TITLE"])) { | ||||
| 		$GLOBALS["HEADER_TITLE"] = "Apps"; | ||||
| 	} | ||||
|   | ||||
| @@ -1,8 +1,6 @@ | ||||
| #!/usr/bin/php | ||||
| <!-- | ||||
| 	Alias for where Books menu item should go. | ||||
| --> | ||||
| <?php | ||||
| 	/* Alias for where Books menu item should go. */ | ||||
| 	if (!isset($GLOBALS["HEADER_TITLE"])) { | ||||
| 		$GLOBALS["HEADER_TITLE"] = "Books"; | ||||
| 	} | ||||
|   | ||||
| @@ -1,8 +1,6 @@ | ||||
| #!/usr/bin/php | ||||
| <!-- | ||||
| 	Alias for the support page with a more common name. | ||||
| --> | ||||
| <?php | ||||
| 	/* Alias for the support page with a more common name. */ | ||||
| 	if (!isset($GLOBALS["HEADER_TITLE"])) { | ||||
| 		$GLOBALS["HEADER_TITLE"] = "Donate"; | ||||
| 	} | ||||
|   | ||||
| @@ -1,8 +1,6 @@ | ||||
| #!/usr/bin/php | ||||
| <!-- | ||||
| 	Page to provide links for Freedom eBook. | ||||
| --> | ||||
| <?php | ||||
| 	/* Page to provide links for Freedom eBook. */ | ||||
| 	$GLOBALS["ADVISORY"] = false; | ||||
| 	if (!isset($GLOBALS["HEADER_TITLE"])) { | ||||
| 		$GLOBALS["HEADER_TITLE"] = "Freedom"; | ||||
| @@ -29,7 +27,7 @@ | ||||
| 		<div class="row"> | ||||
| 			<div class="col-12 text"> | ||||
| 				<p> | ||||
| 					Click the link below to download the 4-page PDF: | ||||
| 					Use the links below to download the 4-page PDF: | ||||
| 				</p> | ||||
| 				<ul class="indent"> | ||||
| 					<li> | ||||
|   | ||||
| @@ -1,8 +1,6 @@ | ||||
| #!/usr/bin/php | ||||
| <!-- | ||||
| 	Page to provide ways people can support me. | ||||
| --> | ||||
| <?php | ||||
| 	/* Page to provide ways people can support me. */ | ||||
| 	//$GLOBALS["ADVISORY"] = false; | ||||
| 	if (!isset($GLOBALS["HEADER_TITLE"])) { | ||||
| 		$GLOBALS["HEADER_TITLE"] = "Health"; | ||||
| @@ -30,7 +28,7 @@ | ||||
| 		<div class="row"> | ||||
| 			<div class="col-12 text"> | ||||
| 				<p> | ||||
| 					Click the link below to download the 10-page PDF: | ||||
| 					Use the links below to download the 10-page PDF: | ||||
| 				</p> | ||||
| 				<ul class="indent"> | ||||
| 					<li> | ||||
|   | ||||
| @@ -7,7 +7,7 @@ | ||||
| 		</div> | ||||
|  | ||||
| 		<div class="row center title" id="advisory"> | ||||
| 			<i><h2 class="col-12 title">Latest Announcement</h2></i> | ||||
| 			<h2 class="col-12 title"><i class="purple">Latest Announcement</i></h2> | ||||
| 			<a href="/freedom/"> | ||||
| 				<div class="col-12 text"> | ||||
| 					<u class="orange">2025-09-28</u> | ||||
|   | ||||
| @@ -10,11 +10,7 @@ | ||||
| 		<a href='/about/'> | ||||
| 			<div class="row"> | ||||
| 				<?php if ($show_pics) echo ' | ||||
| 			<div class="col-3 header center banner-image banner-image01"> | ||||
| 				<!-<img src="/files/media/icons/home.jpg" | ||||
| 					alt="<<banner01.jpg>>" | ||||
| 				>--> | ||||
| 			</div> | ||||
| 				<div class="col-3 header center banner-image banner-image01"></div> | ||||
| 				';?> | ||||
| 				<div class="col-<?php echo "$banner_width"; ?> header"> | ||||
| 					<div class="banner-top">Peace</div> | ||||
| @@ -22,11 +18,7 @@ | ||||
| 					<div class="banner-bottom">Happiness</div> | ||||
| 				</div> | ||||
| 				<?php if ($show_pics) echo ' | ||||
| 			<div class="col-3 header center banner-image banner-image02"> | ||||
| 				<!--<img src="/files/media/icons/contact.jpg" | ||||
| 					alt="<<banner02.jpg>>" | ||||
| 				>--> | ||||
| 			</div> | ||||
| 				<div class="col-3 header center banner-image banner-image02"></div> | ||||
| 				';?> | ||||
| 			</div> | ||||
| 		</a> | ||||
|   | ||||
| @@ -30,16 +30,16 @@ | ||||
| 			<?php include "banner.css"; ?> | ||||
| 		</style> | ||||
|  | ||||
| 		<meta property="og:title" content="Hyperling"/> | ||||
| 		<meta property="og:description" content="Apps, eBooks, media, and other resources from the brands Hyperling and HyperVegan."/> | ||||
| 		<meta property="og:site_name" content="Hyperling"/> | ||||
| 		<meta property="og:url" content="https://hyperling.com/"/> | ||||
| 		<meta property="og:type" content="website"/> | ||||
| 		<meta property="og:image" content="https://hyperling.com/files/media/icons/home.jpg"/> | ||||
| 		<meta name="referrer" content="same-origin"/> | ||||
| 		<meta property="og:title" content="Hyperling"> | ||||
| 		<meta property="og:description" content="Apps, eBooks, media, and other resources from the brands Hyperling and HyperVegan."> | ||||
| 		<meta property="og:site_name" content="Hyperling"> | ||||
| 		<meta property="og:url" content="https://hyperling.com/"> | ||||
| 		<meta property="og:type" content="website"> | ||||
| 		<meta property="og:image" content="https://hyperling.com/files/media/icons/home.jpg"> | ||||
| 		<meta name="referrer" content="same-origin"> | ||||
|  | ||||
| 		<meta name="twitter:card" content="summary_large_image" /> | ||||
| 		<meta name="twitter:title" content="Hyperling" /> | ||||
| 		<meta name="twitter:description" content="Apps, eBooks, media, and other resources from the brands Hyperling and HyperVegan." /> | ||||
| 		<meta name="twitter:image" content="https://hyperling.com/files/media/icons/home.jpg" /> | ||||
| 		<meta name="twitter:card" content="summary_large_image"> | ||||
| 		<meta name="twitter:title" content="Hyperling"> | ||||
| 		<meta name="twitter:description" content="Apps, eBooks, media, and other resources from the brands Hyperling and HyperVegan."> | ||||
| 		<meta name="twitter:image" content="https://hyperling.com/files/media/icons/home.jpg"> | ||||
| 	</head> | ||||
|   | ||||
| @@ -16,4 +16,20 @@ | ||||
| 				</li> | ||||
| 				<li class="col-3 menu-item"><a href="/photos/">Photos</a></li> | ||||
| 			</ul> | ||||
| 			<!-- | ||||
| 			<ul class="menu-list"> | ||||
| 				<li class="col-3 menu-item"></li> | ||||
| 				<li class="col-3 menu-item"> | ||||
| 					<a href="https://blog.hyperling.com" | ||||
| 						target="_blank" rel="noopener noreferrer" | ||||
| 					>Blog</a> | ||||
| 				</li> | ||||
| 				<li class="col-3 menu-item"> | ||||
| 					<a href="https://recipes.hyperling.com" | ||||
| 						target="_blank" rel="noopener noreferrer" | ||||
| 					>Recipes</a> | ||||
| 				</li> | ||||
| 				<li class="col-3 menu-item"></li> | ||||
| 			</ul> | ||||
| 			--> | ||||
| 		</div> | ||||
|   | ||||
| @@ -1,8 +1,6 @@ | ||||
| #!/usr/bin/php | ||||
| <!-- | ||||
| 	Landing page, keeping it apps and development projects like old WordPress site. | ||||
| --> | ||||
| <?php | ||||
| 	/* Landing page, keeping it apps and development projects like old WordPress site. */ | ||||
| 	if (!isset($GLOBALS["HEADER_TITLE"])) { | ||||
| 		$GLOBALS["HEADER_TITLE"] = "Announcements"; | ||||
| 	} | ||||
|   | ||||
| @@ -1,8 +1,6 @@ | ||||
| #!/usr/bin/php | ||||
| <!-- | ||||
| 	Page for my video links. | ||||
| --> | ||||
| <?php | ||||
| 	/* Page for my video links. */ | ||||
| 	if (!isset($GLOBALS["HEADER_TITLE"])) { | ||||
| 		$GLOBALS["HEADER_TITLE"] = "Media"; | ||||
| 	} | ||||
|   | ||||
| @@ -1,8 +1,6 @@ | ||||
| #!/usr/bin/php | ||||
| <!-- | ||||
| 	Lists of items which I'd like to share such as gear and frequently used apps. | ||||
| --> | ||||
| <?php | ||||
| 	/* Lists of items which I'd like to share such as gear and frequently used apps. */ | ||||
| 	if (!isset($GLOBALS["HEADER_TITLE"])) { | ||||
| 		$GLOBALS["HEADER_TITLE"] = "Resources"; | ||||
| 	} | ||||
|   | ||||
| @@ -1,8 +1,6 @@ | ||||
| #!/usr/bin/php | ||||
| <!-- | ||||
| 	Page for my resume and work skill links. | ||||
| --> | ||||
| <?php | ||||
| 	/* Page for my resume and work skill links. */ | ||||
| 	if (!isset($GLOBALS["HEADER_TITLE"])) { | ||||
| 		$GLOBALS["HEADER_TITLE"] = "Resume"; | ||||
| 	} | ||||
|   | ||||
| @@ -54,7 +54,6 @@ | ||||
| 					>Watch the announcement here | (HyperVegan: "Expense Tracker App")</a> | ||||
| 				</p> | ||||
| 			</div> | ||||
| 			</a> | ||||
| 		</div> | ||||
|  | ||||
| 		<div class="row"> | ||||
|   | ||||
| @@ -1,8 +1,6 @@ | ||||
| #!/usr/bin/php | ||||
| <!-- | ||||
| 	Page to provide ways people can support me. | ||||
| --> | ||||
| <?php | ||||
| 	/* Page to provide ways people can support me. */ | ||||
| 	if (!isset($GLOBALS["HEADER_TITLE"])) { | ||||
| 		$GLOBALS["HEADER_TITLE"] = "Support"; | ||||
| 	} | ||||
|   | ||||
| @@ -1,9 +1,9 @@ | ||||
| #!/usr/bin/php | ||||
| <!-- | ||||
| <?php | ||||
| 	/* | ||||
| 		Old page for my video links. | ||||
| 		Deprecated 2024-03-06 for /media. | ||||
| --> | ||||
| <?php | ||||
| 	*/ | ||||
| 	if (!isset($GLOBALS["HEADER_TITLE"])) { | ||||
| 		$GLOBALS["HEADER_TITLE"] = "Videos"; | ||||
| 	} | ||||
|   | ||||
							
								
								
									
										28
									
								
								run.sh
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								run.sh
									
									
									
									
									
								
							| @@ -123,35 +123,15 @@ log "Removing old index files." | ||||
| find files/photos/ -name "*".html -print -delete | ||||
| { | ||||
| 	check_main photos | ||||
| 	count=1 | ||||
| 	http_code=0 | ||||
| 	port="${ports%% *}" | ||||
| 	photos_uri=":$port/photos/" | ||||
| 	beg_time="$SECONDS" | ||||
| 	while [[ $http_code != "200" ]]; do | ||||
| 		log "Sleeping for '$count' while waiting for $photos_uri to come up." | ||||
| 		sleep $count | ||||
| 		log "Checking if $photos_uri is available." | ||||
| 		http_code="`curl --silent --fail -w '\n%{http_code}' localhost$photos_uri | tail -n 1`" | ||||
| 		log "Check for $photos_uri responded with '$http_code'." | ||||
| 		if (( $count >= 10 )); then | ||||
| 			log "Giving up on loading $photos_uri after '$count' attempts." | ||||
| 			break | ||||
| 		else | ||||
| 			count=$(( count + 1 )) | ||||
| 		fi | ||||
| 	done | ||||
| 	end_time="$SECONDS" | ||||
| 	time="$(( $end_time - $beg_time ))" | ||||
| 	log "Finished checking for /photos/ after '$time' seconds." | ||||
| 	$DIR/check_photos.sh "$ports" | ||||
| } & | ||||
|  | ||||
| ## Main ## | ||||
|  | ||||
| log "Start local cronjob." | ||||
| log "Start check_git." | ||||
| while true; do | ||||
| 	check_main cronjob | ||||
| 	$DIR/cronjob.sh | ||||
| 	check_main check_git | ||||
| 	$DIR/check_git.sh | ||||
| 	sleep 30 | ||||
| done & | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user