Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #If used on WSL mind the line endings, only use LF (unix-style)
- echo "RemoteInstall for NXThemeInstaller by exelix"
- echo "Tested on Installer 2.0.1, may break for future versions (hopefully not)"
- IPADDR=$1
- FILENAME=$2
- if [ -z "$FILENAME" ] || [ -z "$IPADDR" ]
- then
- echo "Usage $0 [IpAddress] [fileName]"
- echo "only nxtheme and szs files are supported"
- exit
- fi
- if [ ! -f "$FILENAME" ]; then
- echo "$FILENAME not found!"
- exit
- fi
- FILESIZE=$(stat -c%s "$FILENAME")
- echo "Size of $FILENAME = $FILESIZE bytes."
- printf "theme\x0\x0\x0" > __tmp__theme
- #TODO: detect endianness and write proper size
- printf "0: %.8x" $FILESIZE | sed -E 's/0: (..)(..)(..)(..)/0: \4\3\2\1/' | xxd -r -g0 >>__tmp__theme
- # for Big Endian: printf "0: %.8x" $FILESIZE | xxd -r -g0 >>__tmp__theme
- cat $FILENAME >> __tmp__theme
- echo "Response from $IPADDR: "
- cat __tmp__theme | nc $IPADDR 5000
- rm __tmp__theme
- echo "."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement