January 11, 20179 yr Hello, all. I'm trying to create some aliases for my machine that'll be usuable from any CLI (as I switch between using my IPMI console's KVM box and the "Shell In a Box" plugin. So far, I've had no luck at all. I've tried creating a script that I would run on the array's mounting, putting all of my aliases in the boot/config/go file, and making them append onto the /etc/profile file, all with no success, as whenever I call "alias" in a new CLI window (referring to Shell in a Box), none of my aliases appear. The following are the exact aliases I'm trying to create This is all currently inside of my go file. If anyone has any tips on how to get these aliases available to all CLIs I open as soon as the server is started, It would be greatly appreciated. #======================================================================================================# alias ftpC=' mkdir /tmp/FTP/ && mkdir /tmp/FTP/Media && mkdir /tmp/FTP/Software && mkdir /tmp/FTP/Media/Video && mkdir /tmp/FTP/Media/Audio && mkdir /tmp/FTP/Media/PaperMedia && mkdir /tmp/FTP/Media/Video/Movies && mkdir /tmp/FTP/Media/Video/Shows && mkdir "/tmp/FTP/Media/Video/Bonus Content" && mkdir /tmp/FTP/Media/Video/Random && mkdir /tmp/FTP/Media/Audio/Music && mkdir "/tmp/FTP/Media/Audio/Audio Books" && mkdir /tmp/FTP/Media/PaperMedia/Books && mkdir /tmp/FTP/Media/PaperMedia/Comics'>>/etc/profile #======================================================================================================# alias ftpM='mount --bind /mnt/user/Esoteric/Software /tmp/FTP/Software/ && mount --bind /mnt/user/Files/Media/Videos/Movies /tmp/FTP/Media/Video/Movies/ && mount --bind /mnt/user/Files/Media/Videos/Shows /tmp/FTP/Media/Video/Shows/ && mount --bind "/mnt/user/Files/Media/Videos/Bonus Content" "/tmp/FTP/Media/Video/Bonus Content/" && mount --bind /mnt/user/Files/Media/Videos/Random /tmp/FTP/Media/Video/Random/ && mount --bind "/mnt/user/Files/Media/Audio/Music/iTunes/iTunes Media/Music" /tmp/FTP/Media/Audio/Music/ && mount --bind "/mnt/user/Files/Media/Audio/Audio Books" "/tmp/FTP/Media/Audio/Audio Books" && mount --bind /mnt/user/Files/Media/PaperMedia/books /tmp/FTP/Media/PaperMedia/Books/ && mount --bind /mnt/user/Files/Media/PaperMedia/comics /tmp/FTP/Media/PaperMedia/Comics/'>>/etc/profile #======================================================================================================# alias ftpU='umount /tmp/FTP/Media/Video/Movies/ ; umount /tmp/FTP/Media/Video/Shows/ ; umount /tmp/FTP/Media/Video/Random/ ; umount "/tmp/FTP/Media/Video/Bonus Content/" ; umount /tmp/FTP/Media/PaperMedia/Books/ ; umount /tmp/FTP/Media/PaperMedia/Comics/ ; umount /tmp/FTP/Media/Audio/Music ; umount "/tmp/FTP/Media/Audio/Audio Books" ; umount /tmp/FTP/Software/'>>/etc/profile #======================================================================================================# alias ftpR='rmdir /tmp/FTP/Media/Video/Movies/ ; rmdir /tmp/FTP/Media/Video/Shows/ ; rmdir /tmp/FTP/Media/Video/Random/ ; rmdir "/tmp/FTP/Media/Video/Bonus Content/" ; rmdir /tmp/FTP/Media/PaperMedia/Books/ ; rmdir /tmp/FTP/Media/PaperMedia/Comics/ ; rmdir /tmp/FTP/Media/Audio/Music ; rmdir "/tmp/FTP/Media/Audio/Audio Books" ; rmdir "/tmp/FTP/Software/" ; rmdir /tmp/FTP/Media/Audio/ ; rmdir /tmp/FTP/Media/PaperMedia/ ; rmdir /tmp/FTP/Media/Video/ ; rmdir /tmp/FTP/Media/ ; rmdir /tmp/FTP/'>>/etc/profile #======================================================================================================# alias fbotMVD='find /mnt/user/Files/Media/temp/Movies/ . -name "*.jpg" -type f -delete ; find /mnt/user/Files/Media/temp/Movies/ . -name "*.nfo" -type f -delete; find /mnt/user/Files/Media/temp/Movies/ . -name "*.txt" -type f -delete ; find /mnt/user/Files/Media/temp/Movies/ . -name "*.png" -type f -delete ; find /mnt/user/Files/Media/temp/Movies/ . -name "*.bmp" -type f -delete && find /mnt/user/Files/Media/temp/Movies -type f -print0 | xargs -0 mv -t /mnt/user/Files/Media/temp/_FILEBOT_/ '>>/etc/profile #======================================================================================================# alias fbotTVD='find /mnt/user/Files/Media/temp/"TV Shows"/ . -name "*.jpg" -type f -delete ; find /mnt/user/Files/Media/temp/"TV Shows"/ . -name "*.nfo" -type f -delete; find /mnt/user/Files/Media/temp/"TV Shows"/ . -name "*.txt" -type f -delete ; find /mnt/user/Files/Media/temp/"TV Shows"/ . -name "*.png" -type f -delete ; find /mnt/user/Files/Media/temp/"TV Shows"/ . -name "*.bmp" -type f -delete&& find /mnt/user/Files/Media/temp/"TV Shows" -type f -print0 | xargs -0 mv -t /mnt/user/Files/Media/temp/_FILEBOT_/ '>>/etc/profile #======================================================================================================# alias fbotMVR='filebot -rename /mnt/user/Files/Media/temp/_FILEBOT_ --db TheMovieDB --format {plex} --lang en'>>/etc/profile #======================================================================================================# alias fbotTVR='filebot -rename /mnt/user/Files/Media/temp/_FILEBOT_ --db TheTVDB --format {plex} --lang en'>>/etc/profile #======================================================================================================# alias fbotANR='filebot -rename /mnt/user/Files/Media/temp/_FILEBOT_ --db aniDB --format {plex} --lang en'>>/etc/profile #======================================================================================================# alias fbotDump='mv -v /mnt/user/Files/Media/temp/_FILEBOT_/Movies/* /mnt/user/Files/Media/Videos/Movies;mv -v -f /mnt/user/Files/Media/temp/_FILEBOT_/"TV Shows"/* /mnt/user/Files/Media/Videos/Shows'>>/etc/profile #======================================================================================================# alias size='du -sh --time'>>/etc/profile I'll also attach my go file here. go.txt
January 11, 20179 yr Check /etc/profile, you'll find that the contents are not what you expect. From what I can see, you are redirecting the alias output to /etc/profile rather than writing the alias line to it. Consider the difference between the following two commands: alias size='du -sh --time'>>/etc/profile echo "alias size='du -sh --time'">>/etc/profile Edit: Really, check /etc/profile after making changes to it. Make sure you got your quotes/escaping correct if you are appending to it! Another option is to write the aliases in a separate properly encoded text file with appropriate line endings stored on the flash drive and just append the contents of that one instead. cat /boot/aliases.txt >> /etc/profile
January 11, 20179 yr Author I just checked /etc/profile, and I saw this alias size=du -sh --time . I noticed that the single quotations that define the alias were missing, so I just added "echo" infront of my aliases and the server is restarting. I still don't have the aliases, but now the array isn't mounting. It might just be because I used an IPMI reset to reboot instead of a graceful shutdown, so I'll see how things are going in about 30 minutes.
January 11, 20179 yr Author So, the aliases aren't there. When I used echo, profile had no changed, but when I did the alias without echo, everything appeared except the single quotes
January 11, 20179 yr Author Nevermind, figured it out. I had some very weird file permissions from a messed up chmod -R I did a long time ago. I re-installed unraid and everything is perfect, now.
Archived
This topic is now archived and is closed to further replies.