Create a symbolic link to another symbolic link on linux
Page 1 of 1
Create a symbolic link to another symbolic link on linux
Vid
This script is very powerful and very good for web servers, you can use a windows share to make a mount point (aka symbolic liink) and then use this script to make a symbolic link to that other symbolic link so that you dont have to have tonnes of space on the actual linux web server! also you can do this for any reason, this was just my reason!
This script is very powerful and very good for web servers, you can use a windows share to make a mount point (aka symbolic liink) and then use this script to make a symbolic link to that other symbolic link so that you dont have to have tonnes of space on the actual linux web server! also you can do this for any reason, this was just my reason!
- Code:
#!/bin/bash
#
# (c) J~Net 2020
# jnet.sytes.net
#
# ./set.sh
#
# https://jnet.forumotion.com/t1708-create-a-symbolic-link-to-another-symbolic-link-on-linux#2645
#link a symbolyc link to another!
echo "Welcome To J~Net Symbolic Link Creator"
echo "Listing Current Mounts"
ls /mnt
echo "Enter first sym link that you wish to link to Example: /home/data/A"
read first
echo "Enter where you want the new sym link Example: /var/www/html/symtestfolder"
read second
ln -s "$first" "$second"
# ^--existing ^----new link
file $second
echo "All Done."
Last edited by jamied_uk on 4th September 2020, 17:11; edited 2 times in total
Re: Create a symbolic link to another symbolic link on linux
To Remove Symbolic links
- Code:
#!/bin/bash
#
# (c) J~Net 2020
# jnet.sytes.net
#
# ./del.sh
#
# https://jnet.forumotion.com/t1708-create-a-symbolic-link-to-another-symbolic-link-on-linux#2645
#link a symbolyc link to another!
echo "Welcome To J~Net Symbolic Link Creator"
echo "Listing Current Mounts"
ls /mnt
echo "Enter SymLink To Remove Example: /var/www/html/symtestfolder"
read first
#
sudo rm $first
echo "All Done!"
Re: Create a symbolic link to another symbolic link on linux
If you need the first mount point for a windows share via network on Linux (aka symbolic link).
- Code:
#!/bin/bash
# (c) J~Net 2020
# jnet.sytes.net
#
# https://jnet.forumotion.com/t1708-create-a-symbolic-link-to-another-symbolic-link-on-linux#2645
#
# sudo chmod +x *.sh
# ./run.sh
#
echo "Welcome To Add Mount Point aka Symbolic Link By J~Net"
#
remotehost="192.168.1.30"
echo ""
echo "What name you want for the mountpoint?"
read first
remote_location=$first
if [ "$#" -eq "0" ]
then
echo "Enter Remote IP"
read ip
else
ip=$1
fi
#
#cd smb://$ip/$remote_location/
#ls
sudo mkdir /mnt/$first
clear
# /etc/fstab
newstring="//$ip/$remote_location /mnt/$first cifs credentials=/root/.smbcredentials,uid=33,gid=33,rw,nounix,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0"
sudo echo $newstring >> /etc/fstab
#
clear
echo "Put the following text at bottom of the file thats about to open (Then save and close)...."
echo ""
echo $newstring
sudo xed /etc/fstab
echo "Now checking for new lines..."
sudo mount -a
echo "Now listing files..."
ls /mnt/$first
echo "Now Ready ForSymbolic Linking using set.sh"
Re: Create a symbolic link to another symbolic link on linux
Please note you will need index.php (blank file) if you want to protect from viewing list of files once it is linked!
Similar topics
» LINUX SECTION LINK
» create ssl webserver at last with linux
» Create Anagrams With Bash On Linux
» how to create a free linux localhost proxie
» A guide to help you create your very own custom Firewall for Linux
» create ssl webserver at last with linux
» Create Anagrams With Bash On Linux
» how to create a free linux localhost proxie
» A guide to help you create your very own custom Firewall for Linux
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum