~ubuntu-branches/ubuntu/quantal/lxc/quantal-201208232243

« back to all changes in this revision

Viewing changes to debian/local/lxc-start-ephemeral

  • Committer: Stéphane Graber
  • Date: 2012-08-22 14:50:07 UTC
  • Revision ID: stgraber@ubuntu.com-20120822145007-v9uw0u1u4p5ikkxz
Cleanup all tabs from lxc-start-ephemeral

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
        sudo lxc-stop -n $LXC_NAME
64
64
    fi
65
65
    if [ $LXC_MOUNTED -eq 1 ]; then
66
 
            cleanup_dirs
 
66
        cleanup_dirs
67
67
    fi
68
68
    exit 1
69
69
}
91
91
 
92
92
while true; do
93
93
        case "$1" in
94
 
            -h|--help)
95
 
                help
96
 
                exit 1
97
 
                ;;
98
 
            -o|--orig)
99
 
                shift
100
 
                LXC_BASE=$1
101
 
                shift
102
 
                ;;
103
 
            -b|--bdir)
104
 
                shift
105
 
                LXC_BIND=$1
106
 
                shift
107
 
                ;;
108
 
            -u|--user)
109
 
                shift
110
 
                LXC_USER=$1
111
 
                shift
112
 
                ;;
113
 
            -S|--ssh-key)
114
 
                shift
115
 
                LXC_KEY="-i $1"
116
 
                shift
117
 
                ;;
118
 
            -d|--detach)
119
 
                DAEMON=1
120
 
                shift
121
 
                ;;
122
 
            -U|--union)
123
 
                shift
124
 
                UNION=$1
125
 
                shift
126
 
                ;;
127
 
            --)
128
 
                shift
129
 
                break;;
130
 
            *)
131
 
                echo $1
132
 
                usage
133
 
                exit 1
134
 
                ;;
 
94
            -h|--help)
 
95
            help
 
96
            exit 1
 
97
        ;;
 
98
        -o|--orig)
 
99
            shift
 
100
            LXC_BASE=$1
 
101
            shift
 
102
        ;;
 
103
        -b|--bdir)
 
104
            shift
 
105
            LXC_BIND=$1
 
106
            shift
 
107
        ;;
 
108
        -u|--user)
 
109
            shift
 
110
            LXC_USER=$1
 
111
            shift
 
112
        ;;
 
113
        -S|--ssh-key)
 
114
            shift
 
115
            LXC_KEY="-i $1"
 
116
            shift
 
117
        ;;
 
118
        -d|--detach)
 
119
            DAEMON=1
 
120
            shift
 
121
        ;;
 
122
        -U|--union)
 
123
            shift
 
124
            UNION=$1
 
125
            shift
 
126
        ;;
 
127
        --)
 
128
            shift
 
129
            break;;
 
130
        *)
 
131
            echo $1
 
132
            usage
 
133
            exit 1
 
134
        ;;
135
135
        esac
136
136
done
137
137
 
199
199
                sudo mkdir -p $upperdir
200
200
                sudo chown `sudo stat -c '%U.%G' $source` $upperdir
201
201
                if [ $UNION = "overlayfs" ]; then
202
 
                    echo "none  $path   overlayfs upperdir=$upperdir,lowerdir=$source 0 0";
 
202
                    echo "none $path overlayfs upperdir=$upperdir,lowerdir=$source 0 0";
203
203
                else
204
204
                    echo "none $path aufs br=${upperdir}=rw:${lowerdir}=ro,noplink 0 0";
205
205
                fi
213
213
    # If LXC_BIND is defined, add it to fstab.
214
214
    if [ -n "$LXC_BIND" ]; then
215
215
        sudo mkdir -p $LXC_DIR/rootfs$LXC_BIND
216
 
        echo "$LXC_BIND $LXC_DIR/rootfs$LXC_BIND        none bind 0 0" | sudo tee -a $LXC_DIR/fstab >/dev/null
 
216
        echo "$LXC_BIND $LXC_DIR/rootfs$LXC_BIND none bind 0 0" | sudo tee -a $LXC_DIR/fstab >/dev/null
217
217
    fi
218
218
 
219
219
    # update the ephemeral container's MAC address (lifted from lxc-clone)