3 Revize b2c03c233e ... acdf28849f

Autor SHA1 Zpráva Datum
  Iuri Guilherme acdf28849f Acrescentando CIDv1 atual před 4 roky
  Iuri Guilherme 15aad4d9be IPNS para denise.matehackers.org před 4 roky
  Iuri Guilherme 785f19a9a0 Swapon před 4 roky
2 změnil soubory, kde provedl 23 přidání a 5 odebrání
  1. 9 0
      ipns-denise.bash
  2. 14 5
      swapon.bash

+ 9 - 0
ipns-denise.bash

@@ -0,0 +1,9 @@
+#!/bin/bash
+## Atualiza IPNS para denise.matehackers.org
+## Atualmente ipns/denise.matehackers.org aponta para bafybeiduhsvjotywptuavwbbzwu27zhhc73girdmj5onwtlftvubh72ewy
+
+if [ $(hostname -f) == "denise.matehackers.org" ]
+then
+  ipfs name publish $(ipfs add --cid-version 1 -r -Q /var/www/denise)
+fi
+

+ 14 - 5
swapon.bash

@@ -1,24 +1,33 @@
 #!/bin/bash
 ## Ativa swap no servidor
 
-SWAP_FILE="/srv/swap/swapfile.swap"
+SWAP_FILE_NAME="swapfile.swap"
+SWAP_FILE_PATH="/srv/swap/"
 USER=`whoami`
 SIZE=1048576
 
 if [ ! -z $1 ]
 then
   let SIZE=SIZE*$1
-  echo "Will create a file with ${SIZE} *kibibytes*"
+  echo "Will create a file with ${SIZE} *kibibytes* (${1}GB)"
+  if [ -d $2 ]
+  then
+    SWAP_FILE_PATH="${2}"
+  fi
 else
   echo "Defaulting to 1GB (${SIZE} kibibytes). Use $0 8 for 8GB (1 gibibyte times 8 in powers of 1024)."
 fi
 
+SWAP_FILE="${SWAP_FILE_PATH}/${SWAP_FILE_NAME}"
+
+echo "Will use ${SWAP_FILE} as swap file."
+
 if [ "${USER}" == "root" ]
 then
-  if [ ! -f ${SWAP_FILE} ]
+  if [ ! -f "${SWAP_FILE}" ]
   then
-    mkdir -p $(dirname ${SWAP_FILE})
-    dd if=/dev/zero of="${SWAP_FILE}" bs=1024 count=${SIZE}
+    mkdir -p "${SWAP_FILE_PATH}"
+    dd if=/dev/zero of="${SWAP_FILE}" bs=1024 count=${SIZE} status=progress
   fi
   chmod -v 600 "${SWAP_FILE}"
   mkswap -c "${SWAP_FILE}"