WallpaperChanger add encryptNT
fix paths add encryptNT function fix WC in bash_aliases
This commit is contained in:
1 parent
f5d7962aba
commit
073ddf11fc
2 files changed
+27
-6
No files matched your search
@@ -17,7 +17,9 @@ alias pubip="wget -T 5 -qO- ifconfig.co"
|
||||
alias pubip_country="wget -T 5 -qO- ifconfig.co/country"
|
||||
alias ipinfo='${LOCAL_SCRIPTS}/ip_info.sh'
|
||||
alias pygen="/home/lucas/scripts/.venv/bin/python3"
|
||||
|
||||
alias mv="mv -i"
|
||||
# Wallpaper Changer
|
||||
alias WC="bash /home/lucas/scripts/utils/WallpaperChanger.sh"
|
||||
alias mediawake="bash ${LOCAL_SCRIPTS}/network/wol.sh mediahost -c"
|
||||
alias serverwake="bash ${LOCAL_SCRIPTS}/network/wol.sh serverhost -c"
|
||||
alias quietwake="bash ${LOCAL_SCRIPTS}/network/wol.sh quiethost"
|
||||
@@ -75,8 +77,6 @@ copytorrents() {
|
||||
alias occ="sudo -u www-data php /nextcloud/nextcloud/occ"
|
||||
#Dinfo
|
||||
alias dinfo="${LOCAL_SCRIPTS}/serverhost/deluge-client.sh"
|
||||
# Wallpaper Changer
|
||||
alias WC="bash /home/lucas/scripts/serverhost/WallpaperChangerServer.sh"
|
||||
# Auto shutdown
|
||||
alias autoshutdown_enable="echo "yes" > /home/lucas/.auto_shutdown"
|
||||
alias autoshutdown_disable="echo "no" > /home/lucas/.auto_shutdown"
|
||||
@@ -125,7 +125,6 @@ if [ "${HOST}" == "vivohost" ]; then
|
||||
alias labhost="ssh labhost"
|
||||
|
||||
alias serverhost="ssh serverhost"
|
||||
alias WC="bash /home/lucas/scripts/serverhost/WallpaperChangerServer.sh"
|
||||
alias winboot="sudo efibootmgr --bootnext 0001 && sudo /usr/sbin/reboot"
|
||||
fi
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ elif [ "${HOST}" == "quiethost" ]; then
|
||||
PrivKey="file:/data/Nextcloud/Documents/Dokumente/Projekte/Server/quiethost/IMG_privateKey.pem"
|
||||
elif [ "${HOST}" == "vivohost" ]; then
|
||||
LOG_DIR="/home/lucas/logs/"
|
||||
IMG_DIR="/home/lucas/Nextcloud/Wallpaper/"
|
||||
IMG_DIR="/home/lucas/Nextcloud/Stuff/Wallpaper/"
|
||||
Wallpaper_Dir="${LOG_DIR}Wallpaper"
|
||||
IMG_FOLDER="Desktop1920x1080/"
|
||||
PrivKey="file:/home/lucas/Nextcloud/Dokumente/Projekte/Server/quiethost/IMG_privateKey.pem"
|
||||
@@ -71,7 +71,8 @@ usageX(){
|
||||
-dec_leave\t\tLeave used Images decoded
|
||||
-dec_arg <pattern> -rm(opt)\tDecode certain Images matching pattern *<arg>* and delete entries(opt)
|
||||
-printNT\t\tDecode NT to stdout
|
||||
-modifyNT\t\tDecode NT/Encode if decoded NT present
|
||||
-modifyNT\t\tDecode NT/Encode modded NT if present
|
||||
-encryptNT\t\tEncode if decoded NT present
|
||||
-replace\t\tReplace Image in NT
|
||||
-insta\t\tInsta Mode
|
||||
-check_enc\tCheck for decrypted files
|
||||
@@ -546,6 +547,22 @@ printNamingTable() {
|
||||
echo "No Naming Table under ${file_path}${NAMING_TABLE_ENC}"
|
||||
fi
|
||||
}
|
||||
encryptNT() {
|
||||
IMG_FOLDER_TMP="${X_FOLDER}/"
|
||||
file_path="${IMG_DIR}${IMG_FOLDER_TMP}"
|
||||
if [ -f "${file_path}${NAMING_TABLE_ENC}" ];then
|
||||
echo "Encrypted NT present: ${file_path}${NAMING_TABLE_ENC}"
|
||||
return 1
|
||||
fi
|
||||
if [ -f "${file_path}${NAMING_TABLE}" ];then
|
||||
openssl enc -aes-256-cbc -pbkdf2 -salt -in "${file_path}${NAMING_TABLE}" -out "${file_path}${NAMING_TABLE_ENC}" -pass "${PrivKey}"
|
||||
#rm "${file_path}${NAMING_TABLE}"
|
||||
echo "Encrypting to ${file_path}${NAMING_TABLE_ENC}"
|
||||
else
|
||||
echo "No Naming Table under ${file_path}${NAMING_TABLE}"
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
modifyNT() {
|
||||
IMG_FOLDER_TMP="${X_FOLDER}/"
|
||||
file_path="${IMG_DIR}${IMG_FOLDER_TMP}"
|
||||
@@ -899,6 +916,11 @@ while [[ $# -gt 0 && ${1:0:1} == "-" ]]; do
|
||||
shift 2;
|
||||
exit 0;
|
||||
};
|
||||
[[ $1 == -encryptNT ]] && {
|
||||
encryptNT
|
||||
shift 1;
|
||||
exit 0;
|
||||
}
|
||||
[[ $1 == -modifyNT ]] && {
|
||||
modifyNT
|
||||
shift 1;
|
||||
|
||||
Reference in new issue
Block a user