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
@@ -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