Hello Ashish,
Need to change SafeSquid Logo wherever it is visible to InstaSafe logo.
Replacing SafeSquid Logo With Own Logo
Re: Replacing SafeSquid Logo With Own Logo
To do so, you have to make few minor changes in SafeSquid HTML files.
You can easily replace SafeSquid Logo and set your own company's logo.
We have created a small script. You should get SafeSquidLogoReplacement.sh (Script) at the bottom
You must specify your own image as a parameter and an Optional Parameter.
Additional Parameter: If you also want to change ICON of SafeSquid Title you can do so by Specifying parameter: yes, next to Image File.
To use a Different Image in Title ICON Image you can specify Parameter: Image File, next to Parameter: yes
The below Screenshots will explain you each Case Individually.
Default SafeSquid-SWG Logo and Title ICON
You can easily replace SafeSquid Logo and set your own company's logo.
We have created a small script. You should get SafeSquidLogoReplacement.sh (Script) at the bottom
You must specify your own image as a parameter and an Optional Parameter.
Additional Parameter: If you also want to change ICON of SafeSquid Title you can do so by Specifying parameter: yes, next to Image File.
To use a Different Image in Title ICON Image you can specify Parameter: Image File, next to Parameter: yes
The below Screenshots will explain you each Case Individually.
Default SafeSquid-SWG Logo and Title ICON
Only Change SafeSquid-Logo
OPTION 1: Only Change SafeSquid-Logo
COMMAND: bash safesquidLogoReplacement.sh
After this,
You can then do a CTRL+F5 on your Browser [Which will do a Cache Refresh i.e. It will not fetch the SafeSquid-SWG Logo from Browser Cache]
COMMAND: bash safesquidLogoReplacement.sh
After this,
You can then do a CTRL+F5 on your Browser [Which will do a Cache Refresh i.e. It will not fetch the SafeSquid-SWG Logo from Browser Cache]
Change SafeSquid Title ICON
OPTION 2: Change SafeSquid Title ICON
COMMAND: bash safesquidLogoReplacement.sh instasafe-icon.png yes
After this,
You can then do a CTRL+F5 on your Browser [Which will do a Cache Refresh i.e. It will not fetch the SafeSquid-SWG Logo from Browser Cache]
Also Changing SafeSquid Title ICON
COMMAND: bash safesquidLogoReplacement.sh instasafe-icon.png yes
After this,
You can then do a CTRL+F5 on your Browser [Which will do a Cache Refresh i.e. It will not fetch the SafeSquid-SWG Logo from Browser Cache]
Also Changing SafeSquid Title ICON
Change SafeSquid Title ICON with a Different Image
OPTION 3: Change SafeSquid Title ICON with a Different Image
COMMAND: bash safesquidLogoReplacement.sh instasafe-icon.png yes InstaSafeTitleLogo.PNG
After this,
You can then do a CTRL+F5 on your Browser [Which will do a Cache Refresh i.e. It will not fetch the SafeSquid-SWG Logo from Browser Cache]
COMMAND: bash safesquidLogoReplacement.sh instasafe-icon.png yes InstaSafeTitleLogo.PNG
After this,
You can then do a CTRL+F5 on your Browser [Which will do a Cache Refresh i.e. It will not fetch the SafeSquid-SWG Logo from Browser Cache]
SafeSquidLogoReplacement.sh (Script)
#!/bin/bash
IMAGE_FILE=${1?Error: Please Specify an Image File}
CHANGE_ICON_IMAGE=${2:-NO}
TITLE_LOGO_IMAGE=${3:-same}
## Convert the Image to BASE64 in One Line
BASE64IMAGE=$(base64 --wrap=0 ${IMAGE_FILE})
## SafeSquid Main UI ROOT Sir where all SafeSquid UI Related files are present
SAFESQUID_UI_ROOT="/usr/local/safesquid/ui_root"
SAFESQUID_BLOCK_TEMPLATE="${SAFESQUID_UI_ROOT}/templates/block_bypass.html"
SAFESQUID_UI_CSS_FILE="${SAFESQUID_UI_ROOT}/css/safesquid.css"
SAFESQUID_UI_INDEX_IMAGE_FILE="${SAFESQUID_UI_ROOT}/img/safesquid.png"
## Using sed with -i Option will also create a Backup of the Original File
####################################################################################################
REPLACE SAFESQUID BLOCK_BYPASS TEMPLATE LOGO IMAGE WITH NEW IMAGE:-> DEFAULT; ENABLED
#####################################################################################################
FIND="<img border=\"0\" class=\"image\" src=\"data:image/png;base64,.*\">"
REPLACE="<img border=\"0\" class=\"image\" src=\"data:image/png;base64,${BASE64IMAGE}\">"
sed -i.bckp "s@${FIND}@${REPLACE}@g" ${SAFESQUID_BLOCK_TEMPLATE}
####################################################################################################
REPLACE SAFESQUID UI TEMPLATE LOGO IMAGE WITH NEW IMAGE:-> DEFAULT; ENABLED
####################################################################################################
FIND="background-image:url(data:image/png;base64,.*);"
REPLACE="background-image:url(data:image/png;base64,${BASE64IMAGE});"
sed -i.bckp "s@${FIND}@${REPLACE}@g" ${SAFESQUID_UI_CSS_FILE}
echo "[+] Image Replaced, Changes Done in SafeSquid's Main UI Index File: index.html [+]"
#############################################################################################################
## REPLACE SAFESQUID BLOCK_BYPASS TEMPLATE ICON IMAGE WITH NEW IMAGE:-> DEFAULT IT IS NOT REPLACED : ENABLE IT TO REPLACE IT
##############################################################################################################
##############################################################################################################
REPLACE SAFESQUID UI ICON IMAGE WITH NEW IMAGE:-> DEFAULT; DEFAULT IT IS NOT REPLACED : ENABLE IT TO REPLACE IT
##############################################################################################################
## CONVERT OT LOWER CASE : ${CHANGE_ICON_IMAGE,,}
if [[ ${CHANGE_ICON_IMAGE,,} == "yes" ]];
then
if [[ ${TITLE_LOGO_IMAGE,,} == "same" ]];
then
echo "[+] Using the Same Image for SafeSquid-SWG Title ICON [+]"
else
echo "[+] Using the NEW Image ${TITLE_LOGO_IMAGE} for SafeSquid-SWG Title ICON [+]"
BASE64IMAGE=$(base64 --wrap=0 ${TITLE_LOGO_IMAGE})
IMAGE_FILE=${TITLE_LOGO_IMAGE}
fi
## Change SafeSquid Block Template ICON Image
FIND="<link rel=\"icon\" type=\"image/png\" href=\"data:image/png;base64,.*\/>"
REPLACE="<link rel=\"icon\" type=\"image/png\" href=\"data:image/png;base64,${BASE64IMAGE}\" \/>"
sed -i.bckp "s@${FIND}@${REPLACE}@g" ${SAFESQUID_BLOCK_TEMPLATE}
echo "[+] Changes Done in SafeSquid's BlockTemplate: block_bypass.html [+]"
## Change SafeSquid UI ICON Image
## GET CURRENT TIME
DATE_NOW=$(date +"%y%m%d_%H_%M_%S")
## Take Backup of the Current Image
cp ${SAFESQUID_UI_INDEX_IMAGE_FILE} "${SAFESQUID_UI_INDEX_IMAGE_FILE}_${DATE_NOW}.png"
## Copy the New Image Data into Old SafeSquid Image : safesquid.png : as this is already connected in safesquid's index.html file
cp ${IMAGE_FILE} ${SAFESQUID_UI_INDEX_IMAGE_FILE}
else
echo "[+] Only Logo Images are Modified, To Change SafeSquid ICON Image as well Please Speciify the Second Parameter Next to file as: yes [+]"
fi
IMAGE_FILE=${1?Error: Please Specify an Image File}
CHANGE_ICON_IMAGE=${2:-NO}
TITLE_LOGO_IMAGE=${3:-same}
## Convert the Image to BASE64 in One Line
BASE64IMAGE=$(base64 --wrap=0 ${IMAGE_FILE})
## SafeSquid Main UI ROOT Sir where all SafeSquid UI Related files are present
SAFESQUID_UI_ROOT="/usr/local/safesquid/ui_root"
SAFESQUID_BLOCK_TEMPLATE="${SAFESQUID_UI_ROOT}/templates/block_bypass.html"
SAFESQUID_UI_CSS_FILE="${SAFESQUID_UI_ROOT}/css/safesquid.css"
SAFESQUID_UI_INDEX_IMAGE_FILE="${SAFESQUID_UI_ROOT}/img/safesquid.png"
## Using sed with -i Option will also create a Backup of the Original File
####################################################################################################
REPLACE SAFESQUID BLOCK_BYPASS TEMPLATE LOGO IMAGE WITH NEW IMAGE:-> DEFAULT; ENABLED
#####################################################################################################
FIND="<img border=\"0\" class=\"image\" src=\"data:image/png;base64,.*\">"
REPLACE="<img border=\"0\" class=\"image\" src=\"data:image/png;base64,${BASE64IMAGE}\">"
sed -i.bckp "s@${FIND}@${REPLACE}@g" ${SAFESQUID_BLOCK_TEMPLATE}
####################################################################################################
REPLACE SAFESQUID UI TEMPLATE LOGO IMAGE WITH NEW IMAGE:-> DEFAULT; ENABLED
####################################################################################################
FIND="background-image:url(data:image/png;base64,.*);"
REPLACE="background-image:url(data:image/png;base64,${BASE64IMAGE});"
sed -i.bckp "s@${FIND}@${REPLACE}@g" ${SAFESQUID_UI_CSS_FILE}
echo "[+] Image Replaced, Changes Done in SafeSquid's Main UI Index File: index.html [+]"
#############################################################################################################
## REPLACE SAFESQUID BLOCK_BYPASS TEMPLATE ICON IMAGE WITH NEW IMAGE:-> DEFAULT IT IS NOT REPLACED : ENABLE IT TO REPLACE IT
##############################################################################################################
##############################################################################################################
REPLACE SAFESQUID UI ICON IMAGE WITH NEW IMAGE:-> DEFAULT; DEFAULT IT IS NOT REPLACED : ENABLE IT TO REPLACE IT
##############################################################################################################
## CONVERT OT LOWER CASE : ${CHANGE_ICON_IMAGE,,}
if [[ ${CHANGE_ICON_IMAGE,,} == "yes" ]];
then
if [[ ${TITLE_LOGO_IMAGE,,} == "same" ]];
then
echo "[+] Using the Same Image for SafeSquid-SWG Title ICON [+]"
else
echo "[+] Using the NEW Image ${TITLE_LOGO_IMAGE} for SafeSquid-SWG Title ICON [+]"
BASE64IMAGE=$(base64 --wrap=0 ${TITLE_LOGO_IMAGE})
IMAGE_FILE=${TITLE_LOGO_IMAGE}
fi
## Change SafeSquid Block Template ICON Image
FIND="<link rel=\"icon\" type=\"image/png\" href=\"data:image/png;base64,.*\/>"
REPLACE="<link rel=\"icon\" type=\"image/png\" href=\"data:image/png;base64,${BASE64IMAGE}\" \/>"
sed -i.bckp "s@${FIND}@${REPLACE}@g" ${SAFESQUID_BLOCK_TEMPLATE}
echo "[+] Changes Done in SafeSquid's BlockTemplate: block_bypass.html [+]"
## Change SafeSquid UI ICON Image
## GET CURRENT TIME
DATE_NOW=$(date +"%y%m%d_%H_%M_%S")
## Take Backup of the Current Image
cp ${SAFESQUID_UI_INDEX_IMAGE_FILE} "${SAFESQUID_UI_INDEX_IMAGE_FILE}_${DATE_NOW}.png"
## Copy the New Image Data into Old SafeSquid Image : safesquid.png : as this is already connected in safesquid's index.html file
cp ${IMAGE_FILE} ${SAFESQUID_UI_INDEX_IMAGE_FILE}
else
echo "[+] Only Logo Images are Modified, To Change SafeSquid ICON Image as well Please Speciify the Second Parameter Next to file as: yes [+]"
fi