Script V1.2 + New index page

master
megamov 6 years ago
parent 98d66a8625
commit 6d9b512e8e
  1. 31
      README.md
  2. 21
      add
  3. 48
      index.html

@ -1,30 +1,9 @@
Introduction Introduction ============ This is the default repository for MeGaMoV Public SSH Keys
============ ## Adding me on your server
This is the default repository for MeGaMoV Public SSH Keys
## Adding me on you server
Just getting the script from https://megamov.fr/ssh/add
---
### Automatically ### Automatically
~~~ ~~~ wget https://megamov.fr/ssh/add chmod +x add ./add ~~~
wget https://megamov.fr/ssh/add > **Note:** You can choose one of the public keys from this repo by calling the script like this : ~~~ ./add rsa0520 ~~~
chmod +x add
./add
~~~
#### or #### or
### Manually ### Manually
~~~ cd wget https://megamov.fr/ssh/pub mkdir .ssh cat pub >> .ssh/authorized_keys ~~~ ---
~~~
cd
wget https://megamov.fr/ssh/pub
mkdir .ssh
cat pub >> .ssh/authorized_keys
~~~
---
#### Copyleft © MeGaMoV #### Copyleft © MeGaMoV

21
add

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# VARIABLES # VARIABLES
script_version="1.1" script_version="1.2"
ssh_keys_dir="$HOME/.ssh" ssh_keys_dir="$HOME/.ssh"
netBaseDir="https://megamov.fr/ssh/pub" netBaseDir="https://megamov.fr/ssh/pub"
@ -52,14 +52,6 @@ mega_banner()
echo "+-------------------------------------------+" echo "+-------------------------------------------+"
} }
# Ask for the pub key version
mega_getKeyVersion()
{
mega_show "The key have a specific name ?"
echo -n "NAME [default empty] : "
read keyVersion
}
# Check network by asking script # Check network by asking script
mega_checkNet() mega_checkNet()
{ {
@ -119,14 +111,11 @@ mega_show " Adding SSH Key of Nicolas @MeGaMoV"
mega_show " v$script_version" mega_show " v$script_version"
mega_show mega_show
mega_getKeyVersion keyURL="$netBaseDir$1"
keyURL="$netBaseDir$keyVersion"
# Checking network # Checking network
res=$(mega_checkNet) res=$(mega_checkNet)
if [ "$res" = 1 ]; then if [ "$res" = 1 ]; then
mega_show
mega_show
mega_showerror "[+] Err: Can't access megamov's server." mega_showerror "[+] Err: Can't access megamov's server."
mega_show mega_show
mega_banner mega_banner
@ -136,8 +125,6 @@ fi
# Create .ssh DIR # Create .ssh DIR
res=$(mega_sshDir) res=$(mega_sshDir)
if [ "$res" = 1 ]; then if [ "$res" = 1 ]; then
mega_show
mega_show
mega_showerror "[+] Err: Can't create ssh folder" mega_showerror "[+] Err: Can't create ssh folder"
mega_showerror " $ssh_keys_dir" mega_showerror " $ssh_keys_dir"
mega_show mega_show
@ -148,8 +135,6 @@ fi
# Check if the key exist in server # Check if the key exist in server
res=$(mega_checkPubKey) res=$(mega_checkPubKey)
if [ "$res" = 1 ]; then if [ "$res" = 1 ]; then
mega_show
mega_show
mega_showerror "[+] Error: Unable do get the public key" mega_showerror "[+] Error: Unable do get the public key"
mega_show mega_show
mega_showerror "Please : Check if the NAME you entered" mega_showerror "Please : Check if the NAME you entered"
@ -167,8 +152,6 @@ mega_addPubKey
# Key the IP # Key the IP
IP=$(wget -qO- ip.megamov.fr) IP=$(wget -qO- ip.megamov.fr)
mega_show
mega_show
mega_showsuccess " SSH Public key added !" mega_showsuccess " SSH Public key added !"
mega_showsuccess " Access available from :" mega_showsuccess " Access available from :"
mega_show mega_show

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save