Advertisement
s243a

/usr/bin/fix_ro1.sh

Jun 23rd, 2019
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.43 KB | None | 0 0
  1. #!/bin/sh
  2. . /etc/rc.d/PUPSTATE
  3. SAVE_REL="$(echo $PUPSAVE | cut -d',' -f3)"
  4. SAVE_PATH="/initrd/mnt/dev_save$SAVE_REL"
  5.  
  6. if [ -d "$SAVE_PATH" ] ; then
  7.   if [ -d /initrd/pup_ro1 ]; then
  8.      cp -arfv --remove-destination "$SAVE_PATH"
  9.      rm -rf /initrd/pup_ro1
  10.   elif [ -L /initrd/pup_ro1 ]; then
  11.     rm -rf /initrd/pup_ro1
  12.   fi
  13.   if [ ! -L /initrd/pup_ro1 ]; then
  14.     ln -sv "$SAVE_PATH" /initrd/pup_ro1 #for after switch
  15.   fi
  16. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement